pub struct Stack { /* private fields */ }Expand description
A vector-based implementation of StorageStack, used for testing purpose.
Trait Implementations§
Source§impl StorageStack for Stack
impl StorageStack for Stack
Source§fn push<T>(&mut self, t: T) -> Result<(), Error>where
T: ArgumentEncoder,
fn push<T>(&mut self, t: T) -> Result<(), Error>where
T: ArgumentEncoder,
Save a value to the end of stable memory.
Source§fn pop<T>(&mut self) -> Result<T, Error>where
T: for<'de> ArgumentDecoder<'de>,
fn pop<T>(&mut self) -> Result<T, Error>where
T: for<'de> ArgumentDecoder<'de>,
Pop a value from the end of stable memory.
In case of OutOfBounds error, offset is not changed.
In case of Candid decoding error, offset will be changed anyway.
Auto Trait Implementations§
impl Freeze for Stack
impl !RefUnwindSafe for Stack
impl !Send for Stack
impl !Sync for Stack
impl Unpin for Stack
impl !UnwindSafe for Stack
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