pub struct FopMachine<const WIN: usize, const BUF: usize> { /* private fields */ }Expand description
FOP-1 state machine.
Implements the sender side of COP-1 go-back-N ARQ. Completely synchronous — no I/O, no async.
§Type Parameters
WIN— Maximum sent queue depth (sliding window).BUF— Total FDU buffer size in bytes.
Implementations§
Source§impl<const WIN: usize, const BUF: usize> FopMachine<WIN, BUF>
impl<const WIN: usize, const BUF: usize> FopMachine<WIN, BUF>
Sourcepub fn new(config: FopConfig) -> Self
pub fn new(config: FopConfig) -> Self
Create a new FOP-1 state machine in the Initial (S6) state.
Sourcepub fn get_bd_fdu(&self) -> Option<&[u8]>
pub fn get_bd_fdu(&self) -> Option<&[u8]>
Get the pending BD FDU payload (if any).
Sourcepub fn sent_count(&self) -> usize
pub fn sent_count(&self) -> usize
Number of frames in the sent queue.
Sourcepub fn handle(&mut self, event: FopEvent<'_>, actions: &mut FopActions)
pub fn handle(&mut self, event: FopEvent<'_>, actions: &mut FopActions)
Process an event and emit actions.
Auto Trait Implementations§
impl<const WIN: usize, const BUF: usize> Freeze for FopMachine<WIN, BUF>
impl<const WIN: usize, const BUF: usize> RefUnwindSafe for FopMachine<WIN, BUF>
impl<const WIN: usize, const BUF: usize> Send for FopMachine<WIN, BUF>
impl<const WIN: usize, const BUF: usize> Sync for FopMachine<WIN, BUF>
impl<const WIN: usize, const BUF: usize> Unpin for FopMachine<WIN, BUF>
impl<const WIN: usize, const BUF: usize> UnsafeUnpin for FopMachine<WIN, BUF>
impl<const WIN: usize, const BUF: usize> UnwindSafe for FopMachine<WIN, BUF>
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