[][src]Struct asuran::repository::backend::multifile::manifest::Manifest

pub struct Manifest {
    input: Sender<ManifestCommand>,
    path: String,
}

A message-passing handle to a running manifest

Warnings

  1. In order to ensure that file locks are freed and data is writeen properly, you must ensure that you call the close method on the manifest before your program terminates

Fields

input: Sender<ManifestCommand>path: String

Methods

impl Manifest[src]

pub fn open(
    repository_path: impl AsRef<Path>,
    chunk_settings: Option<ChunkSettings>,
    key: &Key,
    queue_depth: usize
) -> Result<Manifest>
[src]

Opens and reads the manifest, creating it if it does not exist

Note that the repository path is the root path of the repository, not the path of the index folder.

This method will create the manifest folder if it does not exist.

Files whose names are not strictly base 10 integers are ignored, and will not be added to the state or written to.

This method only creates the event loop, the actual manifest is created by InternalManifest::open

This method can optinally set the chunksettings for the manifest, but it is an error to not provide chunk settings if the manifest has not been created yet

Errors

Will return Err if

  1. The manifest folder does not exist and creating it failed
  2. There are no unlocked manifest folders and creating one fails
  3. There is a file called "manifest" in the repository folder
  4. Some other IO error (shuch as lack of permissions) occurs
  5. The path contains non-utf8 characters

TODOs:

  1. Return an error if deserializing a transaciton fails before the end of the file is reached
  2. This function can currently panic if we have to create a new manifest file, but someone else creates the same file we are trying to first.

pub async fn close<'_>(&'_ mut self)[src]

Trait Implementations

impl Clone for Manifest[src]

impl Debug for Manifest[src]

impl Manifest for Manifest[src]

type Iterator = IntoIter<StoredArchive>

Auto Trait Implementations

impl !RefUnwindSafe for Manifest

impl Send for Manifest

impl Sync for Manifest

impl Unpin for Manifest

impl !UnwindSafe for Manifest

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]