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

pub struct Manifest { /* fields omitted */ }
Expand description

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

Implementations

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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Timestamp of the last modification

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

Sets the chunk settings in the repository

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

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