pub enum Content<'a, R> {
    Directory,
    Symlink {
        target: PathBuf,
    },
    File {
        executable: bool,
        size: u64,
        offset: u64,
        data: Take<&'a DecoderInner<R>>,
    },
}
Expand description

The content of an Entry emitted by Decoder.

Variants

Directory

A directory. Its children will follow as separate File entries.

Fields

target: PathBuf

A symlink with a given path. The NAR format imposes no constraints on target, so this symlink could point to anywhere.

File

Fields

executable: bool
size: u64
offset: u64
data: Take<&'a DecoderInner<R>>

May be used to extract the contents of this file.

A file, either plain or executable, with the given contents. The data field is a struct implementing std::io::Read, so it can be read like any file. You must either read data before calling Entries::next on the iterator, or not read it all. Attempting to read data after calling Entries::next is undefined behaviour, and will almost certainly return garbage data.

Implementations

Returns true if the content is Directory.

Returns true if the content is Symlink.

Returns true if the content is File.

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.

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.