Struct async_tar::Archive[][src]

pub struct Archive<R: Read + Unpin> { /* fields omitted */ }
Expand description

A top-level representation of an archive file.

This archive can have an entry added to it and it can be iterated over.

Implementations

Create a new archive with the underlying object as the reader.

Unwrap this archive, returning the underlying object.

Construct an stream over the entries in this archive.

Note that care must be taken to consider each entry within an archive in sequence. If entries are processed out of sequence (from what the stream returns), then the contents read for each entry may be corrupted.

Construct an stream over the raw entries in this archive.

Note that care must be taken to consider each entry within an archive in sequence. If entries are processed out of sequence (from what the stream returns), then the contents read for each entry may be corrupted.

Unpacks the contents tarball into the specified dst.

This function will iterate over the entire contents of this tarball, extracting each file in turn to the location specified by the entry’s path name.

This operation is relatively sensitive in that it will not write files outside of the path specified by dst. Files in the archive which have a ‘..’ in their path are skipped during the unpacking process.

Examples

use async_std::fs::File;
use async_tar::Archive;

let mut ar = Archive::new(File::open("foo.tar").await?);
ar.unpack("foo").await?;

Trait Implementations

Attempt to read from the AsyncRead into buf. Read more

Attempt to read from the AsyncRead into bufs using vectored IO operations. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Reads some bytes from the byte stream. Read more

Like [read()][AsyncReadExt::read()], except it reads into a slice of buffers. Read more

Reads the entire contents and appends them to a Vec. Read more

Reads the entire contents and appends them to a String. Read more

Reads the exact number of bytes required to fill buf. Read more

Creates an adapter which will read at most limit bytes from it. Read more

Converts this [AsyncRead] into a [Stream] of bytes. Read more

Creates an adapter which will chain this stream with another. Read more

Boxes the reader and changes its type to dyn AsyncRead + Send + 'a. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Reads some bytes from the byte stream. Read more

Like read, except that it reads into a slice of buffers. Read more

Reads all bytes from the byte stream. Read more

Reads all bytes from the byte stream and appends them into a string. Read more

Reads the exact number of bytes required to fill buf. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

Creates a “by reference” adaptor for this instance of Read. Read more

Transforms this Read instance to a Stream over its bytes. Read more

Creates an adaptor which will chain this stream with another. Read more

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.