pub struct VectorWriter<'a, 'b, A: ScalarAtom> { /* private fields */ }
Expand description
Handle to append elements to a vector.
This works by allocating a slice of memory behind the vector and then writing your data to it.
Implementations§
Source§impl<'a, 'b, A: ScalarAtom> VectorWriter<'a, 'b, A>
impl<'a, 'b, A: ScalarAtom> VectorWriter<'a, 'b, A>
Sourcepub fn push(&mut self, child: A::InternalType) -> Option<&mut A::InternalType>
pub fn push(&mut self, child: A::InternalType) -> Option<&mut A::InternalType>
Push a single value to the vector.
Sourcepub fn allocate(&mut self, size: usize) -> Option<&mut [A::InternalType]>
pub fn allocate(&mut self, size: usize) -> Option<&mut [A::InternalType]>
Append a slice of undefined memory to the vector.
Using this method, you don’t need to have the elements in memory before you can write them.
Sourcepub fn append(
&mut self,
data: &[A::InternalType],
) -> Option<&mut [A::InternalType]>
pub fn append( &mut self, data: &[A::InternalType], ) -> Option<&mut [A::InternalType]>
Append multiple elements to the vector.
Auto Trait Implementations§
impl<'a, 'b, A> Freeze for VectorWriter<'a, 'b, A>
impl<'a, 'b, A> !RefUnwindSafe for VectorWriter<'a, 'b, A>
impl<'a, 'b, A> !Send for VectorWriter<'a, 'b, A>
impl<'a, 'b, A> !Sync for VectorWriter<'a, 'b, A>
impl<'a, 'b, A> Unpin for VectorWriter<'a, 'b, A>where
A: Unpin,
impl<'a, 'b, A> !UnwindSafe for VectorWriter<'a, 'b, 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