Struct asuran::repository::backend::common::sync_backend::BackendHandle [−][src]
pub struct BackendHandle<B: SyncBackend> { /* fields omitted */ }
Expand description
Wrapper Type for sync backends that converts them into async backends
Functions by moving the provided back end into a dedicated tokio task, and then sending SyncCommands
to instruct that task on what to do.
Implementations
Constructs a new BackendHandle
Spawns a new runner thread to handle commands on.
Takes a closure that produces the required SyncBackend
, in order to allow
injecting non-Send
backends into the spawned threads.
queue_depth
should be a positive (greater than 0) integer, that represents the
number of requests to hold in the processing queue at any given time.
Trait Implementations
type Manifest = Self
type Index = Self
Writes the specified encrypted key to the backend Read more
Attempts to read the encrypted key from the backend.
Returns a view of this respository’s manifest
fn read_chunk<'life0, 'async_trait>(
&'life0 mut self,
location: SegmentDescriptor
) -> Pin<Box<dyn Future<Output = Result<Chunk>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn read_chunk<'life0, 'async_trait>(
&'life0 mut self,
location: SegmentDescriptor
) -> Pin<Box<dyn Future<Output = Result<Chunk>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Starts reading a chunk from the backend Read more
fn write_chunk<'life0, 'async_trait>(
&'life0 mut self,
chunk: Chunk
) -> Pin<Box<dyn Future<Output = Result<SegmentDescriptor>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn write_chunk<'life0, 'async_trait>(
&'life0 mut self,
chunk: Chunk
) -> Pin<Box<dyn Future<Output = Result<SegmentDescriptor>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Starts writing a chunk to the backend Read more
Consumes the current backend handle, and does any work necessary to close out the backend properly Read more
Creates a new trait-object based BackendHandle Read more
fn lookup_chunk<'life0, 'async_trait>(
&'life0 mut self,
id: ChunkID
) -> Pin<Box<dyn Future<Output = Option<SegmentDescriptor>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn lookup_chunk<'life0, 'async_trait>(
&'life0 mut self,
id: ChunkID
) -> Pin<Box<dyn Future<Output = Option<SegmentDescriptor>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Provides the location of a chunk in the repository
Sets the location of a chunk in the repository
Returns the set of all ChunkID
s known to exist in the Asuran repository.
Commits the index
type Iterator = <<B as SyncBackend>::SyncManifest as SyncManifest>::Iterator
fn last_modification<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<DateTime<FixedOffset>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn last_modification<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<DateTime<FixedOffset>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Timestamp of the last modification
fn chunk_settings<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = ChunkSettings> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn chunk_settings<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = ChunkSettings> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the default settings for new chunks in this repository
Returns an iterator over the list of archives in this repository, in reverse chronological order (newest first). Read more
fn write_chunk_settings<'life0, 'async_trait>(
&'life0 mut self,
settings: ChunkSettings
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn write_chunk_settings<'life0, 'async_trait>(
&'life0 mut self,
settings: ChunkSettings
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Sets the chunk settings in the repository
fn write_archive<'life0, 'async_trait>(
&'life0 mut self,
archive: StoredArchive
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn write_archive<'life0, 'async_trait>(
&'life0 mut self,
archive: StoredArchive
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Adds an archive to the manifest
Updates the timestamp without performing any other operations
Provides a list of versions of asuran
that have committed to this manifest, in (SemVer, ImplementationUUID)
Read more
Auto Trait Implementations
impl<B> !RefUnwindSafe for BackendHandle<B>
impl<B> Send for BackendHandle<B>
impl<B> Sync for BackendHandle<B>
impl<B> Unpin for BackendHandle<B>
impl<B> !UnwindSafe for BackendHandle<B>
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