SourceBlockDecoder

Struct SourceBlockDecoder 

Source
pub struct SourceBlockDecoder { /* private fields */ }
Expand description

A struct that represents a source block decoder that uses Raptor codes.

Implementations§

Source§

impl SourceBlockDecoder

Source

pub fn new(nb_source_symbols: usize) -> Self

Create a new decoder

§Arguments
  • nb_source_symbols - Number of source symbols in the block
§Returns
  • A new SourceBlockDecoder instance
Source

pub fn push_encoding_symbol(&mut self, encoding_symbol: &[u8], esi: u32)

Push an encoding symbol to the decoder

§Arguments
  • encoding_symbol - A slice of u8 numbers representing the encoding symbol data
  • esi - Encoding symbol identifier (ESI)
Source

pub fn fully_specified(&self) -> bool

Return true when the block can be fully decoded

Source

pub fn decode(&mut self, source_block_length: usize) -> Option<Vec<u8>>

Decode the source block

§Parameters
  • source_block_length: The size of the source block in bytes.
  • encoding_symbol_size: Size of an encoding symbol
§Returns
  • None if the source block cannot be decoded
  • Some(Vec<u8>) if the block is decoded. The vector contains the decoded source block data

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.