Enum rust_releases_io::Document[][src]

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

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.

Memory(Vec<u8>)

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

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.

Implementations

impl Document[src]

pub fn load(&self) -> IoResult<Vec<u8>>[src]

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

Trait Implementations

impl Debug for Document[src]

impl Eq for Document[src]

impl PartialEq<Document> for Document[src]

impl StructuralEq for Document[src]

impl StructuralPartialEq for Document[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.