Struct reed_solomon_simd::engine::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>
impl<'a> ShardsRefMut<'a>
sourcepub fn dist2_mut(&mut self, pos: usize, dist: usize) -> (&mut [u8], &mut [u8])
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.
sourcepub fn dist4_mut(
&mut self,
pos: usize,
dist: usize
) -> (&mut [u8], &mut [u8], &mut [u8], &mut [u8])
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.
sourcepub fn new(shard_count: usize, shard_bytes: usize, data: &'a mut [u8]) -> Self
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.
sourcepub fn split_at_mut(
&mut self,
mid: usize
) -> (ShardsRefMut<'_>, ShardsRefMut<'_>)
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...
sourcepub fn zero<R: RangeBounds<usize>>(&mut self, range: R)
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>
impl<'a> Index<usize> for ShardsRefMut<'a>
Auto Trait Implementations§
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> 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