Skip to main content

StorageSubstrate

Trait StorageSubstrate 

Source
pub trait StorageSubstrate {
    type Slot;
    type LedgerMemory;
    type MemoryHandle;
    type Error;

    // Required methods
    fn open_ledger(&self) -> Result<Self::LedgerMemory, Self::Error>;
    fn open_slot(
        &self,
        slot: &AllocationSlotDescriptor,
    ) -> Result<Self::MemoryHandle, Self::Error>;
    fn describe_slot(&self, slot: &Self::Slot) -> AllocationSlotDescriptor;
}
Expand description

StorageSubstrate

Physical storage provider for the ledger anchor and allocation slots.

A substrate knows how to open physical storage, but it should not decide allocation history on its own. Frameworks should validate and commit the ledger first, then open slots through crate::AllocationSession.

Required Associated Types§

Source

type Slot

Native slot type accepted by this substrate.

Source

type LedgerMemory

Ledger memory handle.

Source

type MemoryHandle

Allocation memory handle.

Source

type Error

Substrate error type.

Required Methods§

Source

fn open_ledger(&self) -> Result<Self::LedgerMemory, Self::Error>

Open the ledger anchor.

Source

fn open_slot( &self, slot: &AllocationSlotDescriptor, ) -> Result<Self::MemoryHandle, Self::Error>

Open an allocation slot after validation has produced a session.

Source

fn describe_slot(&self, slot: &Self::Slot) -> AllocationSlotDescriptor

Describe a native slot as a durable allocation slot descriptor.

Implementors§