pub trait DecodeSliceBuilder<T, A>: Sizedwhere
A: Allocator,{
// Required methods
fn new<C>(cx: C) -> Result<Self, C::Error>
where C: Context<Allocator = A>;
fn with_capacity<C>(cx: C, capacity: usize) -> Result<Self, C::Error>
where C: Context<Allocator = A>;
fn push<C>(&mut self, cx: C, value: T) -> Result<(), C::Error>
where C: Context<Allocator = A>;
fn reserve<C>(&mut self, cx: C, capacity: usize) -> Result<(), C::Error>
where C: Context<Allocator = A>;
unsafe fn set_len(&mut self, len: usize);
fn as_mut_ptr(&mut self) -> *mut T;
}Expand description
Trait used to decode a slice into a type.
Required Methods§
Sourcefn new<C>(cx: C) -> Result<Self, C::Error>where
C: Context<Allocator = A>,
fn new<C>(cx: C) -> Result<Self, C::Error>where
C: Context<Allocator = A>,
Construct a new empty container.
Sourcefn with_capacity<C>(cx: C, capacity: usize) -> Result<Self, C::Error>where
C: Context<Allocator = A>,
fn with_capacity<C>(cx: C, capacity: usize) -> Result<Self, C::Error>where
C: Context<Allocator = A>,
Construct a new container with the given capacity hint.
Sourcefn push<C>(&mut self, cx: C, value: T) -> Result<(), C::Error>where
C: Context<Allocator = A>,
fn push<C>(&mut self, cx: C, value: T) -> Result<(), C::Error>where
C: Context<Allocator = A>,
Push a value into the container.
Sourcefn reserve<C>(&mut self, cx: C, capacity: usize) -> Result<(), C::Error>where
C: Context<Allocator = A>,
fn reserve<C>(&mut self, cx: C, capacity: usize) -> Result<(), C::Error>where
C: Context<Allocator = A>,
Reserve additional space for capacity elements in the collection.
Sourceunsafe fn set_len(&mut self, len: usize)
unsafe fn set_len(&mut self, len: usize)
Mark the given length as initialized.
§Safety
The caller must ensure that elements up from old_len..len have been
initialized.
Sourcefn as_mut_ptr(&mut self) -> *mut T
fn as_mut_ptr(&mut self) -> *mut T
Get a mutable pointer to the first element in the collection.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".