pub struct Plcw(/* private fields */);Expand description
A Proximity Link Control Word (PLCW).
This is a 16-bit fixed-length SPDU that reports the receiver’s state (V(R), retransmit flag, expedited frame counter) back to the sender via a P-frame.
Implementations§
Source§impl Plcw
impl Plcw
Sourcepub fn new(
retransmit: bool,
pcid: bool,
expedited_counter: u8,
report_value: u8,
) -> Self
pub fn new( retransmit: bool, pcid: bool, expedited_counter: u8, report_value: u8, ) -> Self
Creates a new PLCW with the given fields.
Sourcepub fn from_bytes(bytes: &[u8; 2]) -> Self
pub fn from_bytes(bytes: &[u8; 2]) -> Self
Parses a PLCW from a 2-byte big-endian slice.
Sourcepub fn retransmit(&self) -> bool
pub fn retransmit(&self) -> bool
Returns true if the Retransmit Flag is set.
When set, the sender should retransmit the expected frame.
Sourcepub fn expedited_counter(&self) -> u8
pub fn expedited_counter(&self) -> u8
Returns the 3-bit Expedited Frame Counter (mod-8).
Sourcepub fn report_value(&self) -> u8
pub fn report_value(&self) -> u8
Returns the 8-bit Report Value V(R).
This is the next expected sequence-controlled FSN.
Trait Implementations§
impl Copy for Plcw
impl Eq for Plcw
impl StructuralPartialEq for Plcw
Auto Trait Implementations§
impl Freeze for Plcw
impl RefUnwindSafe for Plcw
impl Send for Plcw
impl Sync for Plcw
impl Unpin for Plcw
impl UnsafeUnpin for Plcw
impl UnwindSafe for Plcw
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