Trait fuel_core_storage::transactional::AtomicView

source ·
pub trait AtomicView: Send + Sync {
    type View;
    type Height;

    // Required methods
    fn latest_height(&self) -> Option<Self::Height>;
    fn view_at(&self, height: &Self::Height) -> StorageResult<Self::View>;
    fn latest_view(&self) -> Self::View;
}
Expand description

Provides a view of the storage at the given height. It guarantees to be atomic, meaning the view is immutable to outside modifications.

Required Associated Types§

source

type View

The type of the storage view.

source

type Height

The type used by the storage to track the commitments at a specific height.

Required Methods§

source

fn latest_height(&self) -> Option<Self::Height>

Returns the latest block height.

source

fn view_at(&self, height: &Self::Height) -> StorageResult<Self::View>

Returns the view of the storage at the given height.

source

fn latest_view(&self) -> Self::View

Returns the view of the storage for the latest block height.

Implementors§