Trait fuel_merkle::storage::StorageMutate
source · pub trait StorageMutate<Type>: StorageInspect<Type>where
Type: Mappable,{
// Required methods
fn insert(
&mut self,
key: &<Type as Mappable>::Key,
value: &<Type as Mappable>::Value
) -> Result<Option<<Type as Mappable>::OwnedValue>, Self::Error>;
fn remove(
&mut self,
key: &<Type as Mappable>::Key
) -> Result<Option<<Type as Mappable>::OwnedValue>, Self::Error>;
}
Expand description
Base storage trait for Fuel infrastructure.
Generic should implement Mappable
trait with all storage type information.
Required Methods§
sourcefn insert(
&mut self,
key: &<Type as Mappable>::Key,
value: &<Type as Mappable>::Value
) -> Result<Option<<Type as Mappable>::OwnedValue>, Self::Error>
fn insert( &mut self, key: &<Type as Mappable>::Key, value: &<Type as Mappable>::Value ) -> Result<Option<<Type as Mappable>::OwnedValue>, Self::Error>
Append Key->Value
mapping to the storage.
If Key
was already mappped to a value, return the replaced value as Ok(Some(Value))
. Return
Ok(None)
otherwise.