iroh_blobs::store

Trait 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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

Available on crate feature fs-store only.
Source§

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

Source§

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