pub struct SliceWriter<'a, T> { /* private fields */ }Expand description
Utility for incrementally filling an uninitialized slice, one SIMD vector at a time.
Implementations§
Source§impl<'a, T: Elem> SliceWriter<'a, T>
impl<'a, T: Elem> SliceWriter<'a, T>
Sourcepub fn new(buf: &'a mut [MaybeUninit<T>]) -> Self
pub fn new(buf: &'a mut [MaybeUninit<T>]) -> Self
Create a writer which initializes elements of buf.
Sourcepub fn write_vec<O: NumOps<T>>(&mut self, ops: O, xs: O::Simd)
pub fn write_vec<O: NumOps<T>>(&mut self, ops: O, xs: O::Simd)
Initialize the next ops.len() elements of the slice from the contents
of SIMD vector xs.
Panics if the slice does not have space for ops.len() elements.
Sourcepub fn write_scalar(&mut self, x: T)
pub fn write_scalar(&mut self, x: T)
Initialize the next element of the slice from x.
Panics if the slice does not have space for writing any more elements.
Sourcepub fn into_mut_slice(self) -> &'a mut [T]
pub fn into_mut_slice(self) -> &'a mut [T]
Finish writing the slice and return the initialized portion.
Auto Trait Implementations§
impl<'a, T> Freeze for SliceWriter<'a, T>
impl<'a, T> RefUnwindSafe for SliceWriter<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for SliceWriter<'a, T>where
T: Send,
impl<'a, T> Sync for SliceWriter<'a, T>where
T: Sync,
impl<'a, T> Unpin for SliceWriter<'a, T>
impl<'a, T> !UnwindSafe for SliceWriter<'a, T>
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