pub struct MaxLenVec<T, const N: usize> { /* private fields */ }Implementations§
Source§impl<T, const N: usize> MaxLenVec<T, N>
impl<T, const N: usize> MaxLenVec<T, N>
pub fn new() -> Self
pub fn is_full(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn contents(&self) -> &[T]
pub fn contents_mut(&mut self) -> &mut [T]
pub fn push(&mut self, elem: T) -> Result<(), &'static str>
pub fn pop(&mut self) -> Option<T>
pub fn cyclic_push(&mut self, elem: T)
pub fn insert(&mut self, index: usize, value: T) -> Result<(), &'static str>
pub fn remove(&mut self, index: usize)
pub fn get_last_element(&self) -> Option<&T>
Trait Implementations§
Source§impl<T, const N: usize> BorshDeserialize for MaxLenVec<T, N>where
Vec<T>: BorshDeserialize,
impl<T, const N: usize> BorshDeserialize for MaxLenVec<T, N>where
Vec<T>: BorshDeserialize,
Source§impl<T, const N: usize> BorshSerialize for MaxLenVec<T, N>where
Vec<T>: BorshSerialize,
impl<T, const N: usize> BorshSerialize for MaxLenVec<T, N>where
Vec<T>: BorshSerialize,
Source§impl<T, const N: usize> MaxSerializedLen for MaxLenVec<T, N>where
T: MaxSerializedLen,
impl<T, const N: usize> MaxSerializedLen for MaxLenVec<T, N>where
T: MaxSerializedLen,
const MAX_SERIALIZED_LEN: usize
Auto Trait Implementations§
impl<T, const N: usize> Freeze for MaxLenVec<T, N>
impl<T, const N: usize> RefUnwindSafe for MaxLenVec<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for MaxLenVec<T, N>where
T: Send,
impl<T, const N: usize> Sync for MaxLenVec<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for MaxLenVec<T, N>where
T: Unpin,
impl<T, const N: usize> UnsafeUnpin for MaxLenVec<T, N>
impl<T, const N: usize> UnwindSafe for MaxLenVec<T, N>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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more