Enum tugger_file_manifest::FileData
source · [−]Expand description
Represents an abstract location for binary data.
Data can be backed by the filesystem or in memory.
Variants
Path(PathBuf)
Memory(Vec<u8>)
Implementations
sourceimpl FileData
impl FileData
sourcepub fn resolve_content(&self) -> Result<Vec<u8>, Error>
pub fn resolve_content(&self) -> Result<Vec<u8>, Error>
Resolve the data for this instance.
If backed by a file, the file will be read.
sourcepub fn to_memory(&self) -> Result<Self, Error>
pub fn to_memory(&self) -> Result<Self, Error>
Convert this instance to a memory variant.
This ensures any file-backed data is present in memory.
sourcepub fn backing_path(&self) -> Option<&Path>
pub fn backing_path(&self) -> Option<&Path>
Obtain a filesystem path backing this content.
Trait Implementations
impl StructuralPartialEq for FileData
Auto Trait Implementations
impl RefUnwindSafe for FileData
impl Send for FileData
impl Sync for FileData
impl Unpin for FileData
impl UnwindSafe for FileData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more