Trait arrayvec::arrayvec_impl::ArrayVecImpl
source · pub(crate) trait ArrayVecImpl {
type Item;
const CAPACITY: usize;
// Required methods
fn len(&self) -> usize;
unsafe fn set_len(&mut self, new_len: usize);
fn as_ptr(&self) -> *const Self::Item;
fn as_mut_ptr(&mut self) -> *mut Self::Item;
// Provided methods
fn as_slice(&self) -> &[Self::Item] { ... }
fn as_mut_slice(&mut self) -> &mut [Self::Item] { ... }
fn push(&mut self, element: Self::Item) { ... }
fn try_push(
&mut self,
element: Self::Item,
) -> Result<(), CapacityError<Self::Item>> { ... }
unsafe fn push_unchecked(&mut self, element: Self::Item) { ... }
fn pop(&mut self) -> Option<Self::Item> { ... }
fn clear(&mut self) { ... }
fn truncate(&mut self, new_len: usize) { ... }
}
Expand description
Implements basic arrayvec methods - based on a few required methods for length and element access.
Required Associated Types§
Required Associated Constants§
Required Methods§
fn len(&self) -> usize
unsafe fn set_len(&mut self, new_len: usize)
sourcefn as_mut_ptr(&mut self) -> *mut Self::Item
fn as_mut_ptr(&mut self) -> *mut Self::Item
Return a raw mutable pointer to the vector’s buffer.
Provided Methods§
sourcefn as_mut_slice(&mut self) -> &mut [Self::Item]
fn as_mut_slice(&mut self) -> &mut [Self::Item]
Return a mutable slice containing all elements of the vector.
fn push(&mut self, element: Self::Item)
fn try_push( &mut self, element: Self::Item, ) -> Result<(), CapacityError<Self::Item>>
unsafe fn push_unchecked(&mut self, element: Self::Item)
fn pop(&mut self) -> Option<Self::Item>
fn clear(&mut self)
fn truncate(&mut self, new_len: usize)
Object Safety§
This trait is not object safe.