Struct asuran::manifest::archive::ActiveArchive [−][src]
pub struct ActiveArchive { /* fields omitted */ }
Expand description
A currently open and able to be modified Archive
This is basically the same thing as an Archive
, but has async/await aware
synchronization types wrapping some shared state, allowing the archive to be
used in multiple tasks at once.
Implementations
pub async fn put_object<R: Read + Send + 'static>(
&mut self,
chunker: &impl AsyncChunker,
repository: &mut Repository<impl BackendClone>,
path: &str,
from_reader: R,
ex: &Executor<'_>
) -> Result<(), ArchiveError>
pub async fn put_object<R: Read + Send + 'static>(
&mut self,
chunker: &impl AsyncChunker,
repository: &mut Repository<impl BackendClone>,
path: &str,
from_reader: R,
ex: &Executor<'_>
) -> Result<(), ArchiveError>
Places an object into a archive, as a whole, without regard to sparsity
Will read holes as 0s
This is implemented as a thin wrapper around put_sparse_object
pub async fn put_sparse_object<R: Read + Send + 'static>(
&mut self,
chunker: &impl AsyncChunker,
repository: &mut Repository<impl BackendClone>,
path: &str,
from_readers: Vec<(Extent, R)>,
ex: &Executor<'_>
) -> Result<(), ArchiveError>
pub async fn put_sparse_object<R: Read + Send + 'static>(
&mut self,
chunker: &impl AsyncChunker,
repository: &mut Repository<impl BackendClone>,
path: &str,
from_readers: Vec<(Extent, R)>,
ex: &Executor<'_>
) -> Result<(), ArchiveError>
Inserts a sparse object into the archive
Requires that the object be pre-split into extents
Inserts an object into the archive without writing any bytes
pub async fn get_object(
&self,
repository: &mut Repository<impl BackendClone>,
path: &str,
restore_to: impl Write
) -> Result<(), ArchiveError>
pub async fn get_object(
&self,
repository: &mut Repository<impl BackendClone>,
path: &str,
restore_to: impl Write
) -> Result<(), ArchiveError>
Retreives an object from the archive, without regard to sparsity.
Will fill in holes with zeros.
pub async fn get_extent(
&self,
repository: &mut Repository<impl BackendClone>,
path: &str,
extent: Extent,
restore_to: impl Write
) -> Result<(), ArchiveError>
pub async fn get_extent(
&self,
repository: &mut Repository<impl BackendClone>,
path: &str,
extent: Extent,
restore_to: impl Write
) -> Result<(), ArchiveError>
Retrieve a single extent of an object from the repository
Will write past the end of the last chunk ends after the extent
pub async fn get_sparse_object(
&self,
repository: &mut Repository<impl BackendClone>,
path: &str,
to_writers: Vec<(Extent, impl Write)>
) -> Result<(), ArchiveError>
pub async fn get_sparse_object(
&self,
repository: &mut Repository<impl BackendClone>,
path: &str,
to_writers: Vec<(Extent, impl Write)>
) -> Result<(), ArchiveError>
Retrieves a sparse object from the repository
Will skip over holes
Will not write to extents that are not specified
Returns the namespace of this archive in string form
Changes namespace by adding the name to the end of the namespace
Returns a new archive
Stores archive metatdat in the repository, producing a Stored Archive object, and consuming the Archive in the process.
Returns the key of the serialized archive in the repository
Provides the timestamp of the archive
Converts an Archive into an ActiveArchive
Converts self into an Archive
Replaces the listing with the provided value
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ActiveArchive
impl Send for ActiveArchive
impl Sync for ActiveArchive
impl Unpin for ActiveArchive
impl !UnwindSafe for ActiveArchive
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more