pub trait BlueprintMutate<M, S>: BlueprintInspect<M, S>where
M: Mappable,
S: KeyValueMutate,{
// Required methods
fn put(
storage: &mut S,
key: &M::Key,
column: S::Column,
value: &M::Value,
) -> StorageResult<()>;
fn replace(
storage: &mut S,
key: &M::Key,
column: S::Column,
value: &M::Value,
) -> StorageResult<Option<M::OwnedValue>>;
fn take(
storage: &mut S,
key: &M::Key,
column: S::Column,
) -> StorageResult<Option<M::OwnedValue>>;
fn delete(
storage: &mut S,
key: &M::Key,
column: S::Column,
) -> StorageResult<()>;
}
Expand description
It is an extension of the BlueprintInspect
that allows mutating the storage.
Required Methods§
Sourcefn put(
storage: &mut S,
key: &M::Key,
column: S::Column,
value: &M::Value,
) -> StorageResult<()>
fn put( storage: &mut S, key: &M::Key, column: S::Column, value: &M::Value, ) -> StorageResult<()>
Puts the key-value pair into the storage.
Sourcefn replace(
storage: &mut S,
key: &M::Key,
column: S::Column,
value: &M::Value,
) -> StorageResult<Option<M::OwnedValue>>
fn replace( storage: &mut S, key: &M::Key, column: S::Column, value: &M::Value, ) -> StorageResult<Option<M::OwnedValue>>
Puts the key-value pair into the storage and returns the old value.
Sourcefn take(
storage: &mut S,
key: &M::Key,
column: S::Column,
) -> StorageResult<Option<M::OwnedValue>>
fn take( storage: &mut S, key: &M::Key, column: S::Column, ) -> StorageResult<Option<M::OwnedValue>>
Takes the value from the storage and returns it. The value is removed from the storage.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.