Struct asuran::repository::Repository[][src]

pub struct Repository<T> {
    pub queue_depth: usize,
    // some fields omitted
}
Expand description

Provides an interface to the storage-backed key value store

File access is abstracted behind a swappable backend, all backends should use roughly the same format, but leeway is made for cases such as S3 having a flat directory structure

Fields

queue_depth: usize

Depth of queues to build

Implementations

Creates a new repository with the specificed backend and defaults

Creates a new repository, accepting a ChunkSettings and a ThreadPool

Commits the index to storage

This should be called every time an archive or manifest is written, at the very least

Writes a chunk directly to the repository

Will return (Chunk_ID, Already_Present)

Already_Present will be true if the chunk already exists in the repository.

Writes a chunk to the repo

Uses all defaults

Will return None if writing the chunk fails. Will not write the chunk if it already exists. Bool in return value will be true if the chunk already existed in the Repository, and false otherwise

Writes a chunk to the repo

Uses all defaults

Will return None if writing the chunk fails. Will not write the chunk if it already exists.

Manually sets the id of the written chunk. This should be used carefully, as it has potential to damage the repository.

Primiarly intended for writing the manifest

Determines if a chunk exists in the index

Reads a chunk from the repo

Returns none if reading the chunk fails

Provides a count of the number of chunks in the repository

Returns the current default chunk settings for this repository

Gets a refrence to the repository’s key

Provides a handle to the backend manifest

Performs any work that would normally be done in a drop impl, but needs to be done asyncronsyly.

Calls into the backend’s implementation

Returns a set of all version and implementation pairs that have touched this repository in the past.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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