FrameControl

Struct FrameControl 

Source
pub struct FrameControl<T: AsRef<[u8]>> { /* private fields */ }
Expand description

A reader/writer for the IEEE 802.15.4 Frame Control field.

Implementations§

Source§

impl<T: AsRef<[u8]>> FrameControl<T>

Source

pub fn new(buffer: T) -> Result<Self>

Create a new FrameControl reader/writer from a given buffer.

§Errors

Returns an error if the buffer is too short.

Source

pub fn new_unchecked(buffer: T) -> Self

Create a new FrameControl reader/writer from a given buffer without length checking.

Source

pub fn into_inner(self) -> T

Return the inner buffer.

Source

pub fn frame_type(&self) -> FrameType

Return the FrameType field.

Source

pub fn security_enabled(&self) -> bool

Returns true when the security enabled field is set.

Source

pub fn frame_pending(&self) -> bool

Returns true when the frame pending field is set.

Source

pub fn ack_request(&self) -> bool

Returns true when the acknowledgement request field is set.

Source

pub fn pan_id_compression(&self) -> bool

Returns true when the PAN ID compression field is set.

Source

pub fn sequence_number_suppression(&self) -> bool

Returns true when the sequence number suppression field is set.

Source

pub fn information_elements_present(&self) -> bool

Returns true when the information element field is set.

Source

pub fn dst_addressing_mode(&self) -> AddressingMode

Return the Destination AddressingMode.

Source

pub fn src_addressing_mode(&self) -> AddressingMode

Return the Source AddressingMode.

Source

pub fn frame_version(&self) -> FrameVersion

Return the FrameVersion.

Source§

impl<T: AsRef<[u8]> + AsMut<[u8]>> FrameControl<T>

Source

pub fn set_frame_type(&mut self, frame_type: FrameType)

Set the frame type field.

Source

pub fn set_security_enabled(&mut self, security_enabled: bool)

Set the security enabled field.

Source

pub fn set_frame_pending(&mut self, frame_pending: bool)

Set the frame pending field.

Source

pub fn set_ack_request(&mut self, ack_request: bool)

Set the acknowledgement request field.

Source

pub fn set_pan_id_compression(&mut self, pan_id_compression: bool)

Set the PAN ID compression field.

Source

pub fn set_sequence_number_suppression( &mut self, sequence_number_suppression: bool, )

Set the sequence number suppression field.

Source

pub fn set_information_elements_present( &mut self, information_elements_present: bool, )

Set the information element present field.

Source

pub fn set_dst_addressing_mode(&mut self, addressing_mode: AddressingMode)

Set the destination addressing mode field.

Source

pub fn set_src_addressing_mode(&mut self, addressing_mode: AddressingMode)

Set the source addressing mode field.

Source

pub fn set_frame_version(&mut self, frame_version: FrameVersion)

Set the frame version field.

Trait Implementations§

Source§

impl<T: AsRef<[u8]>> Display for FrameControl<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for FrameControl<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for FrameControl<T>
where T: RefUnwindSafe,

§

impl<T> Send for FrameControl<T>
where T: Send,

§

impl<T> Sync for FrameControl<T>
where T: Sync,

§

impl<T> Unpin for FrameControl<T>
where T: Unpin,

§

impl<T> UnwindSafe for FrameControl<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.