pub struct Decoder { /* private fields */ }Expand description
RLNC Decoder.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn new(
generation_size: usize,
symbol_size: usize,
) -> Result<Self, RlncError>
pub fn new( generation_size: usize, symbol_size: usize, ) -> Result<Self, RlncError>
Create a new decoder for a generation.
Sourcepub fn generation_size(&self) -> usize
pub fn generation_size(&self) -> usize
Generation size (k).
Sourcepub fn symbol_size(&self) -> usize
pub fn symbol_size(&self) -> usize
Symbol size in bytes.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
True when rank == generation_size.
Sourcepub fn receive(&mut self, pkt: CodedPacket) -> Result<bool, RlncError>
pub fn receive(&mut self, pkt: CodedPacket) -> Result<bool, RlncError>
Receive a coded packet.
Returns true if the packet was innovative (increased rank).
Innovative packet allocations are moved directly into pivot storage. Dependent packets are rejected after coefficient-only reduction, without payload-sized arithmetic or additional allocation.
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnsafeUnpin for Decoder
impl UnwindSafe for Decoder
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