[−][src]Struct ieee802154::mac::frame::header::PanId
Personal Area Network Identifier
A 16-bit value that identifies a PAN
Example
use ieee802154::mac::PanId; let pan_id = PanId(0x0123);
Implementations
impl PanId
[src]
pub fn broadcast() -> Self
[src]
Get the broadcast PAN identifier
pub fn decode(buf: &mut dyn Buf) -> Result<Self, DecodeError>
[src]
Decodes an PAN identifier from a byte buffer
Errors
This function returns an error, if there are not enough bytes in the
buffer to encode a valid Address
instance.
Example
use ieee802154::mac::PanId; let mut bytes = &[0x56, 0x78][..]; let address = PanId::decode(&mut bytes)?; assert_eq!(address.0, 0x7856);
pub fn encode(&self, buf: &mut dyn BufMut)
[src]
Encodes the PAN identifier into a buffer
Example
use ieee802154::mac::PanId; use bytes::BytesMut; let address = PanId(0x1234); let mut bytes = BytesMut::with_capacity(2); address.encode(&mut bytes); let expected_bytes = [0x34, 0x12]; assert_eq!(bytes[..], expected_bytes[..]);
Trait Implementations
impl Clone for PanId
[src]
fn clone(&self) -> PanId
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PanId
[src]
impl Debug for PanId
[src]
impl Eq for PanId
[src]
impl Hash for PanId
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Hash for PanId
[src]
fn hash<H: Hasher>(&self, _h: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
[src]
H: Hasher,
impl PartialEq<PanId> for PanId
[src]
impl StructuralEq for PanId
[src]
impl StructuralPartialEq for PanId
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,