pub trait PartialMap: Map {
    type OutboardMut: OutboardMut;
    type DataWriter: AsyncSliceWriter;
    type PartialEntry: PartialMapEntry<Self>;

    // Required methods
    fn get_or_create_partial(
        &self,
        hash: Hash,
        size: u64
    ) -> Result<Self::PartialEntry>;
    fn get_partial(&self, hash: &Hash) -> Option<Self::PartialEntry>;
    fn insert_complete(
        &self,
        entry: Self::PartialEntry
    ) -> BoxFuture<'_, Result<()>>;
}
Expand description

A mutable bao map

Required Associated Types§

source

type OutboardMut: OutboardMut

The outboard type to write data to the partial entry.

source

type DataWriter: AsyncSliceWriter

The writer type to write data to the partial entry.

source

type PartialEntry: PartialMapEntry<Self>

A partial entry. This is an entry that is writeable and possibly incomplete.

It must also be readable.

Required Methods§

source

fn get_or_create_partial( &self, hash: Hash, size: u64 ) -> Result<Self::PartialEntry>

Get an existing partial entry, or create a new one.

We need to know the size of the partial entry. This might produce an error e.g. if there is not enough space on disk.

source

fn get_partial(&self, hash: &Hash) -> Option<Self::PartialEntry>

Get an existing partial entry.

This will return None if there is no partial entry for this hash.

This function should not block to perform io. The knowledge about partial entries must be present in memory.

source

fn insert_complete( &self, entry: Self::PartialEntry ) -> BoxFuture<'_, Result<()>>

Upgrade a partial entry to a complete entry.

Object Safety§

This trait is not object safe.

Implementors§