pub struct VecBuilder<T> { /* private fields */ }Expand description
Helper to build a vector w/ limited memory consumption.
For small vectors the elements are not copied. For larger vectors the elements are only copied once (in contrast to
O(log n) when using a normal vector w/o pre-allocation).
Implementations§
Source§impl<T> VecBuilder<T>
impl<T> VecBuilder<T>
Sourcepub fn new(expected_elements: usize) -> Self
pub fn new(expected_elements: usize) -> Self
Create new builder.
§Panic
Pancis when block size is too small to hold a single element of T.
Create new builder.
Sourcepub fn new_with_block_size(expected_elements: usize, block_size: usize) -> Self
pub fn new_with_block_size(expected_elements: usize, block_size: usize) -> Self
§Panic
Panics when block size is too small to hold a single element of T.
Source§impl VecBuilder<u8>
impl VecBuilder<u8>
Trait Implementations§
Source§impl<T: Debug> Debug for VecBuilder<T>
impl<T: Debug> Debug for VecBuilder<T>
Source§impl<T> From<VecBuilder<T>> for Vec<T>
impl<T> From<VecBuilder<T>> for Vec<T>
Source§fn from(builder: VecBuilder<T>) -> Self
fn from(builder: VecBuilder<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for VecBuilder<T>
impl<T> RefUnwindSafe for VecBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for VecBuilder<T>where
T: Send,
impl<T> Sync for VecBuilder<T>where
T: Sync,
impl<T> Unpin for VecBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for VecBuilder<T>where
T: UnwindSafe,
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