pub struct StorageMut<'a, T: 'a + ?Sized, Type: Mappable>(/* private fields */);
Expand description
The wrapper around the storage that supports methods from StorageInspect
and
StorageMutate
.
Implementations§
source§impl<'a, T: StorageInspect<Type>, Type: Mappable> StorageMut<'a, T, Type>
impl<'a, T: StorageInspect<Type>, Type: Mappable> StorageMut<'a, T, Type>
source§impl<'a, T, Type> StorageMut<'a, T, Type>where
T: StorageMutate<Type>,
Type: Mappable,
impl<'a, T, Type> StorageMut<'a, T, Type>where
T: StorageMutate<Type>,
Type: Mappable,
pub fn insert( self, key: &Type::Key, value: &Type::Value, ) -> Result<(), T::Error>
pub fn replace( self, key: &Type::Key, value: &Type::Value, ) -> Result<Option<Type::OwnedValue>, T::Error>
pub fn remove(self, key: &Type::Key) -> Result<(), T::Error>
pub fn take(self, key: &Type::Key) -> Result<Option<Type::OwnedValue>, T::Error>
source§impl<'a, T, Type: Mappable> StorageMut<'a, T, Type>
impl<'a, T, Type: Mappable> StorageMut<'a, T, Type>
pub fn root<Key>(self, key: &Key) -> Result<MerkleRoot, T::Error>where
T: MerkleRootStorage<Key, Type>,
source§impl<'a, T, Type> StorageMut<'a, T, Type>where
Type: Mappable,
T: StorageWrite<Type>,
impl<'a, T, Type> StorageMut<'a, T, Type>where
Type: Mappable,
T: StorageWrite<Type>,
pub fn write_bytes( &mut self, key: &Type::Key, buf: &[u8], ) -> Result<usize, T::Error>
pub fn replace_bytes(
&mut self,
key: &Type::Key,
buf: &[u8],
) -> Result<(usize, Option<Vec<u8>>), T::Error>where
T: StorageSize<Type>,
pub fn take_bytes( &mut self, key: &Type::Key, ) -> Result<Option<Vec<u8>>, T::Error>
Auto Trait Implementations§
impl<'a, T, Type> Freeze for StorageMut<'a, T, Type>where
T: ?Sized,
impl<'a, T, Type> RefUnwindSafe for StorageMut<'a, T, Type>
impl<'a, T, Type> Send for StorageMut<'a, T, Type>
impl<'a, T, Type> Sync for StorageMut<'a, T, Type>
impl<'a, T, Type> Unpin for StorageMut<'a, T, Type>
impl<'a, T, Type> !UnwindSafe for StorageMut<'a, T, Type>
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