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§
sourcefn blobs(&self) -> impl Future<Output = Result<DbIter<Hash>>> + Send
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.
list all tags (collections or other explicitly added things) in the database
Temp tags
sourcefn consistency_check(
&self,
repair: bool,
tx: BoxedProgressSender<ConsistencyCheckProgress>
) -> impl Future<Output = Result<()>> + Send
fn consistency_check( &self, repair: bool, tx: BoxedProgressSender<ConsistencyCheckProgress> ) -> impl Future<Output = Result<()>> + Send
Perform a consistency check on the database
sourcefn partial_blobs(&self) -> impl Future<Output = Result<DbIter<Hash>>> + Send
fn partial_blobs(&self) -> impl Future<Output = Result<DbIter<Hash>>> + Send
list partial blobs in the database
sourcefn export(
&self,
hash: Hash,
target: PathBuf,
mode: ExportMode,
progress: ExportProgressCb
) -> impl Future<Output = Result<()>> + Send
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.