Enum rust_releases_io::Document[][src]

pub enum Document {
    LocalPath(PathBuf),
    Memory(Vec<u8>),
    RemoteCached(PathBufVec<u8>),
}
Expand description

A Document represents a resource which can be used as an input to construct a ReleaseIndex.

Variants

LocalPath(PathBuf)

This variant can be used when the document is present on disk (e.g. if pulled from the cache), or accessible locally by following a path.

Tuple Fields of LocalPath

0: PathBuf
Memory(Vec<u8>)

This variant can be used when the document is present in memory

Tuple Fields of Memory

0: Vec<u8>
RemoteCached(PathBufVec<u8>)

This variant can be used when the document has just been downloaded from a remote server, but had to be both written to disk, and used immediately (often in combination with something that implements Write).

The PathBuf represents the path to which the document contents were written (e.g. as cache). The Vec<u8> represents the document contents, so the just downloaded file doesn’t have to be written to the cache location, and read again.

Tuple Fields of RemoteCached

0: PathBuf1: Vec<u8>

Implementations

Load the document to a buffer consisting of bytes (u8).

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

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.