fuel_core_storage

Trait MerkleRootStorage

source
pub trait MerkleRootStorage<Key, StorageType>: StorageInspect<StorageType>
where StorageType: Mappable,
{ // Required method fn root(&self, key: &Key) -> Result<[u8; 32], Self::Error>; }
Expand description

Returns the merkle root for the StorageType per merkle Key. Per one storage, it is possible to have several merkle trees under different Key.

Required Methods§

source

fn root(&self, key: &Key) -> Result<[u8; 32], Self::Error>

Return the merkle root of the stored Type in the storage.

The cryptographic primitive is an arbitrary choice of the implementor and this trait won’t impose any restrictions to that.

Implementations on Foreign Types§

source§

impl<'a, T, Key, Type> MerkleRootStorage<Key, Type> for &'a T
where T: MerkleRootStorage<Key, Type> + ?Sized, Type: Mappable,

source§

fn root( &self, key: &Key, ) -> Result<[u8; 32], <&'a T as StorageInspect<Type>>::Error>

source§

impl<'a, T, Key, Type> MerkleRootStorage<Key, Type> for &'a mut T
where T: MerkleRootStorage<Key, Type> + ?Sized, Type: Mappable,

source§

fn root( &self, key: &Key, ) -> Result<[u8; 32], <&'a mut T as StorageInspect<Type>>::Error>

Implementors§

source§

impl<Column, Key, S, M> MerkleRootStorage<Key, M> for StructuredStorage<S>
where S: KeyValueInspect<Column = Column>, M: TableWithBlueprint<Column = Column>, M::Blueprint: SupportsMerkle<Key, M, StructuredStorage<S>>,

source§

impl<D, K, M: Mappable> MerkleRootStorage<K, M> for VmStorage<D>
where D: MerkleRootStorage<K, M, Error = Error>,