pub struct Data { /* private fields */ }Expand description
A data frame.
Implementations§
Source§impl Data
impl Data
Sourcepub const MIN_PAYLOAD_SIZE: usize = 3usize
pub const MIN_PAYLOAD_SIZE: usize = 3usize
The minimum size of a data frame payload.
Sourcepub const MAX_PAYLOAD_SIZE: usize = 220usize
pub const MAX_PAYLOAD_SIZE: usize = 220usize
The maximum size of a data frame payload.
This is the tested limit on the Siliconlabs MGM210P22A, despite the documentation
stating that 128 bytes is the limit.
Sourcepub const BUFFER_SIZE: usize = 223usize
pub const BUFFER_SIZE: usize = 223usize
The size of a data frame buffer.
Sourcepub fn new(frame_num: WrappingU3, payload: Payload, ack_num: WrappingU3) -> Self
pub fn new(frame_num: WrappingU3, payload: Payload, ack_num: WrappingU3) -> Self
Creates a new data frame.
Sourcepub const fn frame_num(&self) -> WrappingU3
pub const fn frame_num(&self) -> WrappingU3
Returns the frame number.
Sourcepub const fn ack_num(&self) -> WrappingU3
pub const fn ack_num(&self) -> WrappingU3
Returns the acknowledgment number.
Sourcepub const fn is_retransmission(&self) -> bool
pub const fn is_retransmission(&self) -> bool
Returns the retransmit flag.
Sourcepub fn set_is_retransmission(&mut self, is_retransmission: bool)
pub fn set_is_retransmission(&mut self, is_retransmission: bool)
Sets the retransmit flag.
Sourcepub fn into_payload(self) -> Payload
pub fn into_payload(self) -> Payload
Consumes the Data frame and returns its payload.
Trait Implementations§
Source§impl<'data> IntoIterator for &'data Data
impl<'data> IntoIterator for &'data Data
impl Eq for Data
impl StructuralPartialEq for Data
Auto Trait Implementations§
impl Freeze for Data
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnwindSafe for Data
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more