Trait fuel_core_storage::blueprint::BlueprintMutate
source · 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.
Object Safety§
This trait is not object safe.