pub struct StackMemDB<const S: usize> { /* private fields */ }
Implementations§
Source§impl<const S: usize> StackMemDB<S>
impl<const S: usize> StackMemDB<S>
pub fn new() -> Self
pub fn storage_len(&self) -> usize
pub fn insert(&mut self, value: ByteArray32) -> StorageOutcome
Sourcepub fn update(
&mut self,
old_value: ByteArray32,
new_value: ByteArray32,
) -> StorageOutcome
pub fn update( &mut self, old_value: ByteArray32, new_value: ByteArray32, ) -> StorageOutcome
Returns the updated value if any and if the new value already exists, it will fail updating
pub fn remove(&mut self, value: ByteArray32) -> StorageOutcome
pub fn find(&self, value: ByteArray32) -> Option<ByteArray32>
Sourcepub fn find_and_index(
&self,
value: ByteArray32,
) -> (Option<usize>, Option<ByteArray32>)
pub fn find_and_index( &self, value: ByteArray32, ) -> (Option<usize>, Option<ByteArray32>)
FIXME Sometimes returns None
Trait Implementations§
Source§impl<const S: usize> BorshDeserialize for StackMemDB<S>
impl<const S: usize> BorshDeserialize for StackMemDB<S>
Source§impl<const S: usize> BorshSerialize for StackMemDB<S>
impl<const S: usize> BorshSerialize for StackMemDB<S>
Source§impl<const S: usize> Clone for StackMemDB<S>
impl<const S: usize> Clone for StackMemDB<S>
Source§fn clone(&self) -> StackMemDB<S>
fn clone(&self) -> StackMemDB<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<const S: usize> Ord for StackMemDB<S>
impl<const S: usize> Ord for StackMemDB<S>
Source§fn cmp(&self, other: &StackMemDB<S>) -> Ordering
fn cmp(&self, other: &StackMemDB<S>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<const S: usize> PartialEq for StackMemDB<S>
impl<const S: usize> PartialEq for StackMemDB<S>
Source§impl<const S: usize> PartialOrd for StackMemDB<S>
impl<const S: usize> PartialOrd for StackMemDB<S>
impl<const S: usize> Copy for StackMemDB<S>
impl<const S: usize> Eq for StackMemDB<S>
impl<const S: usize> StructuralPartialEq for StackMemDB<S>
Auto Trait Implementations§
impl<const S: usize> Freeze for StackMemDB<S>
impl<const S: usize> RefUnwindSafe for StackMemDB<S>
impl<const S: usize> Send for StackMemDB<S>
impl<const S: usize> Sync for StackMemDB<S>
impl<const S: usize> Unpin for StackMemDB<S>
impl<const S: usize> UnwindSafe for StackMemDB<S>
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