pub struct Archive<R: AsyncRead + AsyncSeek + Unpin> { /* private fields */ }
Expand description

Generic asar archive reader.

It supports any reader that implements AsyncRead, AsyncSeek and Unpin, and adds more methods if the reader implements Send or (Local)Duplicable.

Implementations

Parses an asar archive into Archive.

Returns a reference to its inner reader.

Returns mutable reference to its inner reader.

It is mostly OK to seek the reader’s cursor, since every time accessing its file will reset the cursor to the file’s position. However, write access will compromise Archive’s functionality. Use with great care!

Drops the inner state and returns the reader.

Available on crate feature fs only.

Opens a file and parses it into Archive.

Returns a file from the archive by taking mutable reference.

source

pub fn get_entry(&self, path: &str) -> Option<&Entry>

Returns the entry (“metadata”) of specified path.

Returns a file from the archive by duplicating the inner reader.

Contrary to [Archive::read], it allows multiple read access over a single archive by creating a new file handle for every file. Useful when building a virtual file system like how Electron does.

Returns a file from the archive by duplicating the inner reader, without Sync.

See [Archive::read_owned] for more information.

Available on crate feature fs only.

Extracts the archive to a folder.

Available on crate feature fs only.

Extracts the archive to a folder.

This method is intended for R: !Send. Otherwise, use Archive::extract instead.

Trait Implementations

Formats the value using the given formatter. 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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

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.