Skip to main content

CcsdsRs

Struct CcsdsRs 

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

An interleaved Reed–Solomon codeblock of CCSDS (see the module): the code of correction capability $E$, the interleaving depth $I$ and the virtual fill of $q$ symbols per codeword.

Implementations§

Source§

impl CcsdsRs

Source

pub fn new(e: usize, depth: usize, fill: usize) -> Result<CcsdsRs>

The codeblock of correction capability e (8 or 16 symbols per codeword), depth depth (1, 2, 3, 4, 5 or 8) and virtual fill fill ($q$ symbols per codeword, $Q = q I$ in all; 0 for the full length).

§Errors

Error::Config for another $E$ or $I$, or a fill that leaves no information.

Source

pub fn e(&self) -> usize

The correction capability $E$ of a codeword.

Source

pub fn depth(&self) -> usize

The interleaving depth $I$.

Source

pub fn fill(&self) -> usize

The virtual fill $q$ of a codeword.

Source

pub fn code(&self) -> &ReedSolomon

The conventional code of a codeword (the field of $F(x)$, the roots $\alpha^{11 j}$, shortened by the fill).

Source

pub fn frame_len(&self) -> usize

Octets of a frame, $(255 - 2E - q) I$.

Source

pub fn codeblock_len(&self) -> usize

Octets of a codeblock, $(255 - q) I$.

Source

pub fn encode_bytes(&self, frame: &[u8]) -> Result<Vec<u8>>

The codeblock of a frame (dual-basis octets): the frame, then the $2 E I$ check symbols, codeword $i$ holding the symbols $i, i + I, i + 2I, \dots$ (Sec. 4.4.1).

§Errors

Error::Shape unless the frame has CcsdsRs::frame_len octets.

Source

pub fn decode_bytes(&self, block: &[u8]) -> Result<(Vec<u8>, Option<usize>)>

Decode a received codeblock: the frame and the number of corrected symbols (None if a codeword could not be decoded; its frame symbols are then those received).

§Errors

Error::Shape unless the codeblock has CcsdsRs::codeblock_len octets.

Trait Implementations§

Source§

impl BlockCode for CcsdsRs

Source§

fn decode_block(&self, llr: &[f64]) -> Result<Vec<u8>>

Hard decisions on the LLRs, then CcsdsRs::decode_bytes.

Source§

fn k(&self) -> usize

Information bits per block.
Source§

fn n(&self) -> usize

Coded bits per block.
Source§

fn encode_block(&self, info: &[u8]) -> Result<Vec<u8>>

Encode one block of $k$ bits. Read more
Source§

fn encode_block_into(&self, info: &[u8], out: &mut [u8]) -> Result<()>

Encode one block of $k$ bits into the $n$ values of out (ADR 0011: the default copies BlockCode::encode_block; a code overrides it when a profile shows the copy). Read more
Source§

fn decode_block_into(&self, llr: &[f64], out: &mut [u8]) -> Result<()>

Decode one block of $n$ LLRs into the $k$ values of out (as BlockCode::encode_block_into). Read more
Source§

fn code_rate(&self) -> f64

Code rate $k/n$.
Source§

fn encode_stream(&self, info: &[u8]) -> Result<Vec<u8>>

Encode whole blocks. Read more
Source§

fn decode_stream(&self, llr: &[f64]) -> Result<Vec<u8>>

Decode whole blocks. Read more
Source§

impl Clone for CcsdsRs

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CcsdsRs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Decode for CcsdsRs

Source§

fn decode_into(&mut self, llr: &Llr, out: &mut Bits) -> Result<()>

Decode llr into out. Read more
Source§

fn decode(&mut self, llr: &Llr) -> Result<Bits, Error>

Decode llr (allocates, calls Decode::decode_into). Read more
Source§

impl Encode for CcsdsRs

Source§

fn rate(&self) -> f64

Code rate k/n.
Source§

fn encode_into(&self, info: &Bits, out: &mut Bits) -> Result<()>

Encode info into out. Read more
Source§

fn encode(&self, info: &Bits) -> Result<Bits, Error>

Encode info (allocates, calls Encode::encode_into). Read more
Source§

impl PartialEq for CcsdsRs

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CcsdsRs

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.