Struct Archive

Source
pub struct Archive<B: Backend> { /* private fields */ }
Expand description

The archive.

Implementations§

Source§

impl<B: Backend> Archive<B>

Source

pub fn info(&self) -> Info

Fetches statistics/information from the archive.

Source

pub fn first(&mut self) -> Option<ArchiveResult<Entry<'_, B>, B>>

Returns the first entry in the archive.

Next, you can use Entry::next() to traverse through the archive.

If the archive is empty, None is returned.

Source

pub fn lookup<N: AsRef<str>>( &mut self, name: N, ) -> Option<ArchiveResult<Entry<'_, B>, B>>

Searches for an entry with the given name.

It scans the whole archive and returns the first entry which has the given name wrapped into a Some. If no such entry exists, None is returned.

Source

pub fn append_file<N: AsRef<str>>(&mut self, name: N) -> FileBuilder<'_, B>

Appends a new file entry with the given name at the end of the archive.

The method returns a FileBuilder instance, where you are able to set some more properties for the new entry. Calling FileBuilder::build() will finally create the entry.

Source

pub fn append_directory<N: AsRef<str>>( &mut self, name: N, ) -> DirectoryBuilder<'_, B>

Appends a new directory entry with the given name at the end of the archive.

The method returns a DirectoryBuilder instance, where you are able to set some more properties for the new entry. Calling DirectoryBuilder::build() will finally create the entry.

Appends a new symlink entry with the given name at the end of the archive.

The symlink points to the given target name.

The method returns a SymlinkBuilder instance, where you are able to set some more properties for the new entry. Calling SymlinkBuilder::build() will finally create the entry.

Source

pub fn into_container(self) -> Container<B>

Consumes this Archive, returning the underlying Container.

Trait Implementations§

Source§

impl<B: Backend> AsRef<Container<B>> for Archive<B>

Source§

fn as_ref(&self) -> &Container<B>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<B: Backend + 'static> Service<B> for Archive<B>

Source§

type Migration = Migration<B>

The migration assiciated with this service.
Source§

fn sid() -> u32

The service identifier. Read more
Source§

fn need_top_id() -> bool

Returns true if the service requires a top-id. Read more
Source§

fn migration() -> Migration<B>

Returns the migration assiciated with this service.

Auto Trait Implementations§

§

impl<B> Freeze for Archive<B>
where <B as Backend>::Id: Freeze, B: Freeze, <B as Backend>::Settings: Freeze,

§

impl<B> !RefUnwindSafe for Archive<B>

§

impl<B> !Send for Archive<B>

§

impl<B> !Sync for Archive<B>

§

impl<B> Unpin for Archive<B>
where <B as Backend>::Id: Unpin, B: Unpin, <B as Backend>::Settings: Unpin,

§

impl<B> !UnwindSafe for Archive<B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.