Struct asuran::repository::backend::multifile::manifest::Manifest [−][src]
pub struct Manifest { /* fields omitted */ }
Expand description
A message-passing handle to a running manifest
Warnings
- 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
- The manifest folder does not exist and creating it failed
- There are no unlocked manifest folders and creating one fails
- There is a file called “manifest” in the repository folder
- Some other IO error (shuch as lack of permissions) occurs
- The path contains non-utf8 characters
TODOs:
- Return an error if deserializing a transaciton fails before the end of the file is reached
- 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
type Iterator = IntoIter<StoredArchive>
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 !RefUnwindSafe for Manifest
impl !UnwindSafe for Manifest
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