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 entry_status(&self, hash: &Hash) -> EntryStatus;
    fn get_possibly_partial(&self, hash: &Hash) -> PossiblyPartialEntry<Self>;
    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 entry_status(&self, hash: &Hash) -> EntryStatus

Find out if the data behind a hash is complete, partial, or not present.

Note that this does not actually verify the on-disc data, but only checks in which section of the store the entry is present.

source

fn get_possibly_partial(&self, hash: &Hash) -> PossiblyPartialEntry<Self>

Get an existing entry.

This will return either a complete entry, a partial entry, or not found.

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§