Struct concordium_std::test_infrastructure::TestStateApi
source · [−]pub struct TestStateApi { /* private fields */ }
Expand description
A state api used for testing. Implements HasStateApi
.
Implementations
sourceimpl TestStateApi
impl TestStateApi
Trait Implementations
sourceimpl Clone for TestStateApi
impl Clone for TestStateApi
sourcefn clone(&self) -> TestStateApi
fn clone(&self) -> TestStateApi
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 Debug for TestStateApi
impl Debug for TestStateApi
sourceimpl Default for TestStateApi
impl Default for TestStateApi
sourceimpl HasStateApi for TestStateApi
impl HasStateApi for TestStateApi
type EntryType = TestStateEntry
type IterType = TestStateIter
sourcefn create_entry(&mut self, key: &[u8]) -> Result<Self::EntryType, StateError>
fn create_entry(&mut self, key: &[u8]) -> Result<Self::EntryType, StateError>
Create a new entry in the state. If an entry with the given key already exists then it is reset to an empty entry. If the part of the tree where the key points to is locked due to an acquired iterator then no entry is created, and an error will be returned. Read more
sourcefn lookup_entry(&self, key: &[u8]) -> Option<Self::EntryType>
fn lookup_entry(&self, key: &[u8]) -> Option<Self::EntryType>
Lookup an entry in the state.
sourcefn delete_entry(&mut self, entry: Self::EntryType) -> Result<(), StateError>
fn delete_entry(&mut self, entry: Self::EntryType) -> Result<(), StateError>
Delete an entry. Returns an error if the entry did not exist, or if it is part of a locked subtree. Read more
sourcefn delete_prefix(&mut self, prefix: &[u8]) -> Result<bool, StateError>
fn delete_prefix(&mut self, prefix: &[u8]) -> Result<bool, StateError>
Delete the entire subtree. Returns whether any values were deleted, or an error if the given prefix is part of a locked subtree. Read more
sourcefn iterator(&self, prefix: &[u8]) -> Result<Self::IterType, StateError>
fn iterator(&self, prefix: &[u8]) -> Result<Self::IterType, StateError>
Get an iterator over a map in the state. Read more
sourcefn delete_iterator(&mut self, iter: Self::IterType)
fn delete_iterator(&mut self, iter: Self::IterType)
Auto Trait Implementations
impl !RefUnwindSafe for TestStateApi
impl !Send for TestStateApi
impl !Sync for TestStateApi
impl Unpin for TestStateApi
impl !UnwindSafe for TestStateApi
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more