Trait fuel_storage::Mappable
source · [−]Expand description
Mappable type with Key
and Value
.
Required Associated Types
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<'a>(PhantomData<&'a ()>);
impl<'a> Mappable for Contract<'a> {
type Key = &'a [u8; 32];
/// It is optimized to use slice instead of vector.
type SetValue = [u8];
type GetValue = Vec<u8>;
}