Trait fuel_storage::Mappable
source · Expand description
Mappable type with Key
and Value
.
Required Associated Types§
sourcetype SetValue: ?Sized
type SetValue: ?Sized
The value type is used while setting the value to the storage. In most cases, it is the same
as Self::GetValue
, but it is without restriction and can be used for performance
optimizations.
Example
use core::marker::PhantomData;
use fuel_storage::Mappable;
pub struct Contract;
impl Mappable for Contract {
type Key<'a> = &'a [u8; 32];
/// It is optimized to use slice instead of vector.
type SetValue = [u8];
type GetValue = Vec<u8>;
}