Struct spl_stake_pool::big_vec::BigVec
source · pub struct BigVec<'data> {
pub data: &'data mut [u8],
}
Expand description
Contains easy to use utilities for a big vector of Borsh-compatible types, to avoid managing the entire struct on-chain and blow through stack limits.
Fields§
§data: &'data mut [u8]
Underlying data buffer, pieces of which are serialized
Implementations§
source§impl<'data> BigVec<'data>
impl<'data> BigVec<'data>
sourcepub fn retain<T: Pod, F: Fn(&[u8]) -> bool>(
&mut self,
predicate: F
) -> Result<(), ProgramError>
pub fn retain<T: Pod, F: Fn(&[u8]) -> bool>( &mut self, predicate: F ) -> Result<(), ProgramError>
Retain all elements that match the provided function, discard all others
sourcepub fn deserialize_mut_slice<T: Pod>(
&mut self,
skip: usize,
len: usize
) -> Result<&mut [T], ProgramError>
pub fn deserialize_mut_slice<T: Pod>( &mut self, skip: usize, len: usize ) -> Result<&mut [T], ProgramError>
Extracts a slice of the data types
sourcepub fn deserialize_slice<T: Pod>(
&self,
skip: usize,
len: usize
) -> Result<&[T], ProgramError>
pub fn deserialize_slice<T: Pod>( &self, skip: usize, len: usize ) -> Result<&[T], ProgramError>
Extracts a slice of the data types
sourcepub fn push<T: Pod>(&mut self, element: T) -> Result<(), ProgramError>
pub fn push<T: Pod>(&mut self, element: T) -> Result<(), ProgramError>
Add new element to the end
Auto Trait Implementations§
impl<'data> RefUnwindSafe for BigVec<'data>
impl<'data> Send for BigVec<'data>
impl<'data> Sync for BigVec<'data>
impl<'data> Unpin for BigVec<'data>
impl<'data> !UnwindSafe for BigVec<'data>
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