reed_solomon_16::engine

Struct ShardsRefMut

Source
pub struct ShardsRefMut<'a> { /* private fields */ }
Expand description

Mutable reference to shard array implemented as flat byte array.

Implementations§

Source§

impl<'a> ShardsRefMut<'a>

Source

pub fn dist2_mut(&mut self, pos: usize, dist: usize) -> (&mut [u8], &mut [u8])

Returns mutable references to shards at pos and pos + dist.

See source code of Naive::fft for an example.

§Panics

If dist is 0.

Source

pub fn dist4_mut( &mut self, pos: usize, dist: usize, ) -> (&mut [u8], &mut [u8], &mut [u8], &mut [u8])

Returns mutable references to shards at pos, pos + dist, pos + dist * 2 and pos + dist * 3.

See source code of NoSimd::fft for an example (specifically the private method fft_butterfly_two_layers).

§Panics

If dist is 0.

Source

pub fn is_empty(&self) -> bool

Returns true if this contains no shards.

Source

pub fn len(&self) -> usize

Returns number of shards.

Source

pub fn new(shard_count: usize, shard_bytes: usize, data: &'a mut [u8]) -> Self

Creates new ShardsRefMut that references given data.

§Panics

If data is smaller than shard_count * shard_bytes bytes.

Source

pub fn split_at_mut( &mut self, mid: usize, ) -> (ShardsRefMut<'_>, ShardsRefMut<'_>)

Splits this ShardsRefMut into two so that first includes shards 0..mid and second includes shards mid...

Source

pub fn zero<R: RangeBounds<usize>>(&mut self, range: R)

Fills the given shard-range with 0u8:s.

Trait Implementations§

Source§

impl<'a> Index<usize> for ShardsRefMut<'a>

Source§

type Output = [u8]

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a> IndexMut<usize> for ShardsRefMut<'a>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ShardsRefMut<'a>

§

impl<'a> RefUnwindSafe for ShardsRefMut<'a>

§

impl<'a> Send for ShardsRefMut<'a>

§

impl<'a> Sync for ShardsRefMut<'a>

§

impl<'a> Unpin for ShardsRefMut<'a>

§

impl<'a> !UnwindSafe for ShardsRefMut<'a>

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.