Trait iroh_blobs::store::ReadableStore

source ·
pub trait ReadableStore: Map {
    // Required methods
    fn blobs(&self) -> impl Future<Output = Result<DbIter<Hash>>> + Send;
    fn tags(
        &self
    ) -> impl Future<Output = Result<DbIter<(Tag, HashAndFormat)>>> + Send;
    fn temp_tags(
        &self
    ) -> Box<dyn Iterator<Item = HashAndFormat> + Send + Sync + 'static>;
    fn consistency_check(
        &self,
        repair: bool,
        tx: BoxedProgressSender<ConsistencyCheckProgress>
    ) -> impl Future<Output = Result<()>> + Send;
    fn partial_blobs(&self) -> impl Future<Output = Result<DbIter<Hash>>> + Send;
    fn export(
        &self,
        hash: Hash,
        target: PathBuf,
        mode: ExportMode,
        progress: ExportProgressCb
    ) -> impl Future<Output = Result<()>> + Send;
}
Expand description

Extension of Map to add misc methods used by the rpc calls.

Required Methods§

source

fn blobs(&self) -> impl Future<Output = Result<DbIter<Hash>>> + Send

list all blobs in the database. This includes both raw blobs that have been imported, and hash sequences that have been created internally.

source

fn tags( &self ) -> impl Future<Output = Result<DbIter<(Tag, HashAndFormat)>>> + Send

list all tags (collections or other explicitly added things) in the database

source

fn temp_tags( &self ) -> Box<dyn Iterator<Item = HashAndFormat> + Send + Sync + 'static>

Temp tags

source

fn consistency_check( &self, repair: bool, tx: BoxedProgressSender<ConsistencyCheckProgress> ) -> impl Future<Output = Result<()>> + Send

Perform a consistency check on the database

source

fn partial_blobs(&self) -> impl Future<Output = Result<DbIter<Hash>>> + Send

list partial blobs in the database

source

fn export( &self, hash: Hash, target: PathBuf, mode: ExportMode, progress: ExportProgressCb ) -> impl Future<Output = Result<()>> + Send

This trait method extracts a file to a local path.

hash is the hash of the file target is the path to the target file mode is a hint how the file should be exported. progress is a callback that is called with the total number of bytes that have been written

Object Safety§

This trait is not object safe.

Implementors§

source§

impl ReadableStore for iroh_blobs::store::fs::Store

source§

impl ReadableStore for iroh_blobs::store::mem::Store

source§

impl ReadableStore for iroh_blobs::store::readonly_mem::Store