Enum tugger_file_manifest::FileData[][src]

pub enum FileData {
    Path(PathBuf),
    Memory(Vec<u8>),
}

Represents an abstract location for binary data.

Data can be backed by the filesystem or in memory.

Variants

Path(PathBuf)
Memory(Vec<u8>)

Implementations

impl FileData[src]

pub fn resolve(&self) -> Result<Vec<u8>, Error>[src]

Resolve the data for this instance.

If backed by a file, the file will be read.

pub fn to_memory(&self) -> Result<Self, Error>[src]

Convert this instance to a memory variant.

This ensures any file-backed data is present in memory.

Trait Implementations

impl Clone for FileData[src]

impl Debug for FileData[src]

impl From<&'_ [u8]> for FileData[src]

impl From<&'_ Path> for FileData[src]

impl From<PathBuf> for FileData[src]

impl From<Vec<u8, Global>> for FileData[src]

impl PartialEq<FileData> for FileData[src]

impl StructuralPartialEq for FileData[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.