pub struct Decoder<R: Read> { /* private fields */ }
Expand description

Decoder that can extract the contents of NAR files.

Implementations

Create a new decoder over the given Reader. Consider wrapping it in a std::io::BufReader for performance.

Construct an iterator over the entries in this archive.

You must consider each entry within an archive in sequence. If entries are processed out of sequence (from what the iterator returns), then the contents read for each entry may be corrupted.

Unpacks the contents of the NAR file to the given destination (which must not already exist).

This operation will not 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.

No attempt is made to validate the targets of symlinks.

If the NAR file is invalid, this function returns an error. For instance, this happens if an Entry’s parent doesn’t exist or is not a directory.

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.

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.