Struct stack_memdb::StackMemDB
source · [−]pub struct StackMemDB<const S: usize> { /* private fields */ }Implementations
sourceimpl<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
sourceimpl<const S: usize> BorshDeserialize for StackMemDB<S> where
[ByteArray32; S]: BorshDeserialize,
impl<const S: usize> BorshDeserialize for StackMemDB<S> where
[ByteArray32; S]: BorshDeserialize,
sourceimpl<const S: usize> BorshSerialize for StackMemDB<S> where
[ByteArray32; S]: BorshSerialize,
impl<const S: usize> BorshSerialize for StackMemDB<S> where
[ByteArray32; S]: BorshSerialize,
sourceimpl<const S: usize> Clone for StackMemDB<S>
impl<const S: usize> Clone for StackMemDB<S>
sourcefn clone(&self) -> StackMemDB<S>
fn clone(&self) -> StackMemDB<S>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<const S: usize> Ord for StackMemDB<S>
impl<const S: usize> Ord for StackMemDB<S>
sourceimpl<const S: usize> PartialEq<StackMemDB<S>> for StackMemDB<S>
impl<const S: usize> PartialEq<StackMemDB<S>> for StackMemDB<S>
sourcefn eq(&self, other: &StackMemDB<S>) -> bool
fn eq(&self, other: &StackMemDB<S>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &StackMemDB<S>) -> bool
fn ne(&self, other: &StackMemDB<S>) -> bool
This method tests for !=.
sourceimpl<const S: usize> PartialOrd<StackMemDB<S>> for StackMemDB<S>
impl<const S: usize> PartialOrd<StackMemDB<S>> for StackMemDB<S>
sourcefn partial_cmp(&self, other: &StackMemDB<S>) -> Option<Ordering>
fn partial_cmp(&self, other: &StackMemDB<S>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<const S: usize> Copy for StackMemDB<S>
impl<const S: usize> Eq for StackMemDB<S>
impl<const S: usize> StructuralEq for StackMemDB<S>
impl<const S: usize> StructuralPartialEq for StackMemDB<S>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more