pub struct Encoder { /* private fields */ }Expand description
RLNC Encoder.
Implementations§
Source§impl Encoder
impl Encoder
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 encoder.
generation_size(k): number of source symbols per generation.symbol_size(n): bytes per source symbol.
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 (n).
Sourcepub fn encode_random(
&self,
source: &[&[u8]],
rng: &mut SimpleRng,
) -> Result<CodedPacket, RlncError>
pub fn encode_random( &self, source: &[&[u8]], rng: &mut SimpleRng, ) -> Result<CodedPacket, RlncError>
Encode one random-linear coded packet.
Uses adaptive multi-source AXPY (kernel::axpy_multi): cache-blocked
kernels for small symbols and fused GFNI kernels for large symbols.
source must contain exactly generation_size slices, each of
length symbol_size. rng provides the random coefficients.
Sourcepub fn encode_systematic(
&self,
source: &[&[u8]],
index: usize,
) -> Result<CodedPacket, RlncError>
pub fn encode_systematic( &self, source: &[&[u8]], index: usize, ) -> Result<CodedPacket, RlncError>
Produce a systematic coded packet for source symbol index.
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnsafeUnpin for Encoder
impl UnwindSafe for Encoder
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