Trait fuel_storage::StorageSize

source ·
pub trait StorageSize<Type: Mappable>: StorageInspect<Type> {
    // Required method
    fn size_of_value(
        &self,
        key: &Type::Key,
    ) -> Result<Option<usize>, Self::Error>;
}
Expand description

Base storage trait for Fuel infrastructure.

Allows checking the size of the value stored at a given key. Checking the size of a value is a cheap operation and should not require copying the value into a buffer.

Required Methods§

source

fn size_of_value(&self, key: &Type::Key) -> Result<Option<usize>, Self::Error>

Return the number of bytes stored at this key.

Implementations on Foreign Types§

source§

impl<'a, T: StorageSize<Type> + ?Sized, Type: Mappable> StorageSize<Type> for &'a T

source§

fn size_of_value( &self, key: &<Type as Mappable>::Key, ) -> Result<Option<usize>, Self::Error>

source§

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

source§

fn size_of_value( &self, key: &<Type as Mappable>::Key, ) -> Result<Option<usize>, Self::Error>

Implementors§