commit | f40fafc2208dae6c4989d447114c7fbcc26d5e3d | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Oct 28 17:30:07 2021 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Oct 28 17:30:07 2021 +0000 |
tree | 7abd48419fd15ceb455806e87b4b18624e992c1e | |
parent | 92d4957098ba7786505d11a22c6a416b2b81d103 [diff] | |
parent | 58b8387590c16465d360bb72bd887ba44f99a500 [diff] |
Snap for 7862349 from 58b8387590c16465d360bb72bd887ba44f99a500 to t-keystone-qcom-release Change-Id: I5f83e027e234f0ffb54a5508a9942d4dd28e2814
MAC address types for Rust
This crate provides types for a MAC address identifiers, both in IEEE EUI-48 and EUI-64 formats.
It is like a std::net::SocketAddr
enum with a std::net::SocketAddrV4
and std::net::SocketAddrV6
members, but for MAC addresses instead.
Obviously, MAC address can be represented as a [u8; 6]
or [u8; 8]
, but it is error-prone and inconvenient, so here they are — MacAddr6 and MacAddr8 structs with helpful methods and standard Rust traits implementations, intended to be the first-class Rust objects.
And it is serde
- and no_std
-friendly also!
Add this to your Cargo.toml
[dependencies] macaddr = "1.0"
Check out the documentation for each type available, all of them have a plenty of examples.
Licensed under either of Apache License 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.