Struct iroh_bytes::store::flat::Store
source · pub struct Store(/* private fields */);Expand description
Flat file database implementation.
This
Implementations§
Trait Implementations§
source§impl Map for Store
impl Map for Store
§type Entry = Entry
type Entry = Entry
The entry type. An entry is a cheaply cloneable handle that can be used
to open readers for both the data and the outboard
§type Outboard = PreOrderOutboard<MemOrFile>
type Outboard = PreOrderOutboard<MemOrFile>
The outboard type. This can be an in memory outboard or an outboard that
retrieves the data asynchronously from a remote database.
§type DataReader = MemOrFile
type DataReader = MemOrFile
The reader type.
source§impl MapEntry<Store> for Entry
impl MapEntry<Store> for Entry
source§fn available_ranges(&self) -> BoxFuture<'_, Result<ChunkRanges>>
fn available_ranges(&self) -> BoxFuture<'_, Result<ChunkRanges>>
Compute the available ranges. Read more
source§fn outboard(&self) -> BoxFuture<'_, Result<PreOrderOutboard<MemOrFile>>>
fn outboard(&self) -> BoxFuture<'_, Result<PreOrderOutboard<MemOrFile>>>
A future that resolves to a reader that can be used to read the outboard
source§fn data_reader(&self) -> BoxFuture<'_, Result<MemOrFile>>
fn data_reader(&self) -> BoxFuture<'_, Result<MemOrFile>>
A future that resolves to a reader that can be used to read the data
source§fn is_complete(&self) -> bool
fn is_complete(&self) -> bool
Returns
true if the entry is complete. Read moresource§impl MapEntry<Store> for PartialEntry
impl MapEntry<Store> for PartialEntry
source§fn available_ranges(&self) -> BoxFuture<'_, Result<ChunkRanges>>
fn available_ranges(&self) -> BoxFuture<'_, Result<ChunkRanges>>
Compute the available ranges. Read more
source§fn outboard(&self) -> BoxFuture<'_, Result<<Store as Map>::Outboard>>
fn outboard(&self) -> BoxFuture<'_, Result<<Store as Map>::Outboard>>
A future that resolves to a reader that can be used to read the outboard
source§fn data_reader(&self) -> BoxFuture<'_, Result<<Store as Map>::DataReader>>
fn data_reader(&self) -> BoxFuture<'_, Result<<Store as Map>::DataReader>>
A future that resolves to a reader that can be used to read the data
source§fn is_complete(&self) -> bool
fn is_complete(&self) -> bool
Returns
true if the entry is complete. Read moresource§impl PartialMap for Store
impl PartialMap for Store
§type OutboardMut = PreOrderOutboard<File>
type OutboardMut = PreOrderOutboard<File>
The outboard type to write data to the partial entry.
§type DataWriter = File
type DataWriter = File
The writer type to write data to the partial entry.
§type PartialEntry = PartialEntry
type PartialEntry = PartialEntry
A partial entry. This is an entry that is writeable and possibly incomplete. Read more
source§fn get_partial(&self, hash: &Hash) -> Option<Self::PartialEntry>
fn get_partial(&self, hash: &Hash) -> Option<Self::PartialEntry>
Get an existing partial entry. Read more
source§fn get_or_create_partial(
&self,
hash: Hash,
size: u64
) -> Result<Self::PartialEntry>
fn get_or_create_partial( &self, hash: Hash, size: u64 ) -> Result<Self::PartialEntry>
Get an existing partial entry, or create a new one. Read more
source§fn insert_complete(
&self,
entry: Self::PartialEntry
) -> BoxFuture<'_, Result<()>>
fn insert_complete( &self, entry: Self::PartialEntry ) -> BoxFuture<'_, Result<()>>
Upgrade a partial entry to a complete entry.
source§impl PartialMapEntry<Store> for PartialEntry
impl PartialMapEntry<Store> for PartialEntry
source§fn outboard_mut(
&self
) -> BoxFuture<'_, Result<<Store as PartialMap>::OutboardMut>>
fn outboard_mut( &self ) -> BoxFuture<'_, Result<<Store as PartialMap>::OutboardMut>>
A future that resolves to an writeable outboard
source§fn data_writer(
&self
) -> BoxFuture<'_, Result<<Store as PartialMap>::DataWriter>>
fn data_writer( &self ) -> BoxFuture<'_, Result<<Store as PartialMap>::DataWriter>>
A future that resolves to a writer that can be used to write the data
source§impl ReadableStore for Store
impl ReadableStore for Store
source§fn blobs(&self) -> Box<dyn Iterator<Item = Hash> + Send + Sync + 'static>
fn blobs(&self) -> Box<dyn Iterator<Item = Hash> + Send + Sync + 'static>
list all blobs in the database. This should include collections, since
collections are blobs and can be requested as blobs. Read more
Temp tags
list all tags (collections or other explicitly added things) in the database Read more
source§fn validate(&self, _tx: Sender<ValidateProgress>) -> BoxFuture<'_, Result<()>>
fn validate(&self, _tx: Sender<ValidateProgress>) -> BoxFuture<'_, Result<()>>
Validate the database
source§impl Store for Store
impl Store for Store
source§fn import_file(
&self,
path: PathBuf,
mode: ImportMode,
format: BlobFormat,
progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator
) -> BoxFuture<'_, Result<(TempTag, u64)>>
fn import_file( &self, path: PathBuf, mode: ImportMode, format: BlobFormat, progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator ) -> BoxFuture<'_, Result<(TempTag, u64)>>
This trait method imports a file from a local path. Read more
source§fn import_bytes(
&self,
data: Bytes,
format: BlobFormat
) -> BoxFuture<'_, Result<TempTag>>
fn import_bytes( &self, data: Bytes, format: BlobFormat ) -> BoxFuture<'_, Result<TempTag>>
Import data from memory. Read more
source§fn import_stream(
&self,
data: impl Stream<Item = Result<Bytes>> + Unpin + Send + 'static,
format: BlobFormat,
progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator
) -> BoxFuture<'_, Result<(TempTag, u64)>>
fn import_stream( &self, data: impl Stream<Item = Result<Bytes>> + Unpin + Send + 'static, format: BlobFormat, progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator ) -> BoxFuture<'_, Result<(TempTag, u64)>>
Import data from a stream of bytes.
source§fn create_tag(&self, value: HashAndFormat) -> BoxFuture<'_, Result<Tag>>
fn create_tag(&self, value: HashAndFormat) -> BoxFuture<'_, Result<Tag>>
Create a new tag
source§fn set_tag(
&self,
name: Tag,
value: Option<HashAndFormat>
) -> BoxFuture<'_, Result<()>>
fn set_tag( &self, name: Tag, value: Option<HashAndFormat> ) -> BoxFuture<'_, Result<()>>
Set a tag
source§fn temp_tag(&self, tag: HashAndFormat) -> TempTag
fn temp_tag(&self, tag: HashAndFormat) -> TempTag
Create a temporary pin for this store
source§fn clear_live(&self)
fn clear_live(&self)
Clear the live set.
source§fn add_live(&self, elements: impl IntoIterator<Item = Hash>)
fn add_live(&self, elements: impl IntoIterator<Item = Hash>)
Add the given hashes to the live set. Read more
source§fn delete(&self, hash: &Hash) -> BoxFuture<'_, Result<()>>
fn delete(&self, hash: &Hash) -> BoxFuture<'_, Result<()>>
physically delete the given hash from the store.
source§fn import_reader(
&self,
data: impl AsyncRead + Send + Unpin + 'static,
format: BlobFormat,
progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator
) -> BoxFuture<'_, Result<(TempTag, u64)>>
fn import_reader( &self, data: impl AsyncRead + Send + Unpin + 'static, format: BlobFormat, progress: impl ProgressSender<Msg = ImportProgress> + IdGenerator ) -> BoxFuture<'_, Result<(TempTag, u64)>>
Import data from an async byte reader.
source§fn gc_mark<'a>(
&'a self,
extra_roots: impl IntoIterator<Item = Result<HashAndFormat>> + 'a
) -> LocalBoxStream<'a, GcMarkEvent>
fn gc_mark<'a>( &'a self, extra_roots: impl IntoIterator<Item = Result<HashAndFormat>> + 'a ) -> LocalBoxStream<'a, GcMarkEvent>
Traverse all roots recursively and mark them as live. Read more
source§fn gc_sweep(&self) -> LocalBoxStream<'_, GcSweepEvent>
fn gc_sweep(&self) -> LocalBoxStream<'_, GcSweepEvent>
Remove all blobs that are not marked as live. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl !UnwindSafe for Store
Blanket Implementations§
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