Struct iroh_blobs::store::mem::Store
source · pub struct Store { /* private fields */ }
Expand description
A fully featured in memory database for iroh-blobs, including support for partial blobs.
Implementations§
Trait Implementations§
source§impl MapMut for Store
impl MapMut for Store
source§async fn get_mut(&self, hash: &Hash) -> Result<Option<Self::EntryMut>>
async fn get_mut(&self, hash: &Hash) -> Result<Option<Self::EntryMut>>
Get an existing entry as an EntryMut. Read more
source§async fn get_or_create(&self, hash: Hash, _size: u64) -> Result<Entry>
async fn get_or_create(&self, hash: Hash, _size: u64) -> Result<Entry>
Get an existing partial entry, or create a new one. Read more
source§async fn entry_status(&self, hash: &Hash) -> Result<EntryStatus>
async fn entry_status(&self, hash: &Hash) -> Result<EntryStatus>
Find out if the data behind a
hash
is complete, partial, or not present. Read moresource§fn entry_status_sync(&self, hash: &Hash) -> Result<EntryStatus>
fn entry_status_sync(&self, hash: &Hash) -> Result<EntryStatus>
Sync version of
entry_status
, for the doc sync engine until we can get rid of it. Read moresource§impl ReadableStore for Store
impl ReadableStore for Store
source§async fn blobs(&self) -> Result<DbIter<Hash>>
async fn blobs(&self) -> Result<DbIter<Hash>>
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
source§async fn consistency_check(
&self,
_repair: bool,
_tx: BoxedProgressSender<ConsistencyCheckProgress>
) -> Result<()>
async fn consistency_check( &self, _repair: bool, _tx: BoxedProgressSender<ConsistencyCheckProgress> ) -> Result<()>
Perform a consistency check on the database
source§async fn export(
&self,
hash: Hash,
target: PathBuf,
mode: ExportMode,
progress: ExportProgressCb
) -> Result<()>
async fn export( &self, hash: Hash, target: PathBuf, mode: ExportMode, progress: ExportProgressCb ) -> Result<()>
This trait method extracts a file to a local path. Read more
source§impl Store for Store
impl Store for Store
source§async fn import_file(
&self,
path: PathBuf,
_mode: ImportMode,
format: BlobFormat,
progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator
) -> Result<(TempTag, u64)>
async fn import_file( &self, path: PathBuf, _mode: ImportMode, format: BlobFormat, progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator ) -> Result<(TempTag, u64)>
This trait method imports a file from a local path. Read more
source§async fn import_stream(
&self,
data: impl Stream<Item = Result<Bytes>> + Unpin + Send + 'static,
format: BlobFormat,
progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator
) -> Result<(TempTag, u64)>
async fn import_stream( &self, data: impl Stream<Item = Result<Bytes>> + Unpin + Send + 'static, format: BlobFormat, progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator ) -> Result<(TempTag, u64)>
Import data from a stream of bytes.
source§async fn import_bytes(
&self,
bytes: Bytes,
format: BlobFormat
) -> Result<TempTag>
async fn import_bytes( &self, bytes: Bytes, format: BlobFormat ) -> Result<TempTag>
Import data from memory. Read more
source§async fn create_tag(&self, hash: HashAndFormat) -> Result<Tag>
async fn create_tag(&self, hash: HashAndFormat) -> Result<Tag>
Create a new tag
source§fn temp_tag(&self, tag: HashAndFormat) -> TempTag
fn temp_tag(&self, tag: HashAndFormat) -> TempTag
Create a temporary pin for this store
source§async fn delete(&self, hashes: Vec<Hash>) -> Result<()>
async fn delete(&self, hashes: Vec<Hash>) -> Result<()>
physically delete the given hashes from the store.
source§fn import_reader(
&self,
data: impl AsyncRead + Send + Unpin + 'static,
format: BlobFormat,
progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator
) -> impl Future<Output = Result<(TempTag, u64)>> + Send
fn import_reader( &self, data: impl AsyncRead + Send + Unpin + 'static, format: BlobFormat, progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator ) -> impl Future<Output = Result<(TempTag, u64)>> + Send
Import data from an async byte reader.
Auto Trait Implementations§
impl Freeze for Store
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnwindSafe for Store
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more