DecodeSliceBuilder

Trait DecodeSliceBuilder 

Source
pub trait DecodeSliceBuilder<T, A>: Sized
where 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§

Source

fn new<C>(cx: C) -> Result<Self, C::Error>
where C: Context<Allocator = A>,

Construct a new empty container.

Source

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.

Source

fn push<C>(&mut self, cx: C, value: T) -> Result<(), C::Error>
where C: Context<Allocator = A>,

Push a value into the container.

Source

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.

Source

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.

Source

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", so this trait is not object safe.

Implementors§