Skip to main content

DefaultRateDecoder

Struct DefaultRateDecoder 

Source
pub struct DefaultRateDecoder<E: Engine>(/* private fields */);
Expand description

Reed-Solomon decoder using high or low rate as appropriate.

This is basically same as Decoder except with slightly different API which allows specifying Engine and DecoderWork.

Trait Implementations§

Source§

impl<E: Engine> RateDecoder<E> for DefaultRateDecoder<E>

Source§

type Rate = DefaultRate<E>

Rate of this decoder.
Source§

fn validate( original_count: usize, recovery_count: usize, shard_bytes: usize, ) -> Result<(), Error>

Checks that the shard counts are supported, the shard size is nonzero and even, and this decoder’s working space fits in a single allocation.
Source§

fn add_original_shard<T: AsRef<[u8]>>( &mut self, index: usize, original_shard: T, ) -> Result<(), Error>

Source§

fn add_recovery_shard<T: AsRef<[u8]>>( &mut self, index: usize, recovery_shard: T, ) -> Result<(), Error>

Source§

fn decode( &mut self, compute_recovery: bool, ) -> Result<Option<DecoderResult<'_>>, Error>

Like Decoder::decode, this reconstructs the missing shards, or returns Ok(None) if every original was already provided (nothing to reconstruct). When compute_recovery is set, the missing recovery shards are also reconstructed into the work buffers. The returned DecoderResult exposes only restored original shards, so callers of this trait should pass false. Reconstructed recovery shards are readable through Decoder::decode_with_recovery and Decoder::decode_with_recovery_plan.
Source§

fn into_parts(self) -> (E, DecoderWork)

Consumes this decoder returning its Engine and DecoderWork so that they can be re-used by another decoder.
Source§

fn new( original_count: usize, recovery_count: usize, shard_bytes: usize, engine: E, work: Option<DecoderWork>, ) -> Result<Self, Error>

Like Decoder::new with Engine to use and optional working space to be re-used.
Source§

fn reset( &mut self, original_count: usize, recovery_count: usize, shard_bytes: usize, ) -> Result<(), Error>

Source§

fn supports(original_count: usize, recovery_count: usize) -> bool

Returns true if given original_count / recovery_count combination is supported. Read more

Auto Trait Implementations§

§

impl<E> Freeze for DefaultRateDecoder<E>
where InnerDecoder<E>: Freeze,

§

impl<E> RefUnwindSafe for DefaultRateDecoder<E>
where InnerDecoder<E>: RefUnwindSafe,

§

impl<E> Send for DefaultRateDecoder<E>
where InnerDecoder<E>: Send,

§

impl<E> Sync for DefaultRateDecoder<E>
where InnerDecoder<E>: Sync,

§

impl<E> Unpin for DefaultRateDecoder<E>
where InnerDecoder<E>: Unpin,

§

impl<E> UnsafeUnpin for DefaultRateDecoder<E>
where InnerDecoder<E>: UnsafeUnpin,

§

impl<E> UnwindSafe for DefaultRateDecoder<E>
where InnerDecoder<E>: UnwindSafe,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Threaded<T> for T

Source§

type Rest = ()

The outputs beyond the threaded value.
Source§

fn split(self) -> (T, ())

Splits into the threaded value and the extra outputs.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more