Struct simple_file_manifest::FileEntry
source · [−]pub struct FileEntry { /* private fields */ }
Expand description
Represents a virtual file, without an associated path.
Implementations
sourceimpl FileEntry
impl FileEntry
sourcepub fn new_from_data(data: impl Into<FileData>, executable: bool) -> Self
pub fn new_from_data(data: impl Into<FileData>, executable: bool) -> Self
Construct a new instance given data and an executable bit.
sourcepub fn new_from_path(path: impl AsRef<Path>, executable: bool) -> Self
pub fn new_from_path(path: impl AsRef<Path>, executable: bool) -> Self
Construct a new instance referencing a path.
sourcepub fn is_executable(&self) -> bool
pub fn is_executable(&self) -> bool
Whether the file is executable.
sourcepub fn set_executable(&mut self, v: bool)
pub fn set_executable(&mut self, v: bool)
Set whether the file is executable.
sourcepub fn resolve_content(&self) -> Result<Vec<u8>, Error>
pub fn resolve_content(&self) -> Result<Vec<u8>, Error>
Resolve the data constituting this file.
sourcepub fn link_target(&self) -> Option<&Path>
pub fn link_target(&self) -> Option<&Path>
Obtain the target of a link, if this is a link entry.
sourcepub fn set_link_target(&mut self, target: PathBuf)
pub fn set_link_target(&mut self, target: PathBuf)
Set the target of a link.
sourcepub fn to_memory(&self) -> Result<Self, Error>
pub fn to_memory(&self) -> Result<Self, Error>
Obtain a new instance guaranteed to have file data stored in memory.
sourcepub fn write_to_path(
&self,
dest_path: impl AsRef<Path>
) -> Result<(), FileManifestError>
pub fn write_to_path(
&self,
dest_path: impl AsRef<Path>
) -> Result<(), FileManifestError>
Write this file entry to the given destination path.
Trait Implementations
impl StructuralPartialEq for FileEntry
Auto Trait Implementations
impl RefUnwindSafe for FileEntry
impl Send for FileEntry
impl Sync for FileEntry
impl Unpin for FileEntry
impl UnwindSafe for FileEntry
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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