pub struct Ext4(/* private fields */);Expand description
Read-only access to an ext4 filesystem.
Implementations§
Source§impl Ext4
impl Ext4
Source§impl Ext4
impl Ext4
These methods mirror the std::fs API.
Sourcepub fn canonicalize<'p, P>(&self, path: P) -> Result<PathBuf, Ext4Error>
pub fn canonicalize<'p, P>(&self, path: P) -> Result<PathBuf, Ext4Error>
Get the canonical, absolute form of a path with all intermediate components normalized and symbolic links resolved.
§Errors
An error will be returned if:
pathis not absolute.pathdoes not exist.
This is not an exhaustive list of errors, see the crate documentation.
Sourcepub fn read<'p, P>(&self, path: P) -> Result<Vec<u8>, Ext4Error>
pub fn read<'p, P>(&self, path: P) -> Result<Vec<u8>, Ext4Error>
Read the entire contents of a file as raw bytes.
§Errors
An error will be returned if:
pathis not absolute.pathdoes not exist.pathis a directory or special file type.
This is not an exhaustive list of errors, see the crate documentation.
Sourcepub fn read_to_string<'p, P>(&self, path: P) -> Result<String, Ext4Error>
pub fn read_to_string<'p, P>(&self, path: P) -> Result<String, Ext4Error>
Read the entire contents of a file as a string.
§Errors
An error will be returned if:
pathis not absolute.pathdoes not exist.pathis a directory or special file type.
This is not an exhaustive list of errors, see the crate documentation.
Sourcepub fn read_link<'p, P>(&self, path: P) -> Result<PathBuf, Ext4Error>
pub fn read_link<'p, P>(&self, path: P) -> Result<PathBuf, Ext4Error>
Get the target of a symbolic link.
The final component of path must be a symlink. If the path
contains any symlinks in components prior to the end, they will
be fully resolved as normal.
§Errors
An error will be returned if:
pathis not absolute.- The final component of
pathis not a symlink.
This is not an exhaustive list of errors, see the crate documentation.
Sourcepub fn read_dir<'p, P>(&self, path: P) -> Result<ReadDir, Ext4Error>
pub fn read_dir<'p, P>(&self, path: P) -> Result<ReadDir, Ext4Error>
Get an iterator over the entries in a directory.
§Errors
An error will be returned if:
pathis not absolute.pathdoes not existpathis not a directory
This is not an exhaustive list of errors, see the crate documentation.
Sourcepub fn exists<'p, P>(&self, path: P) -> Result<bool, Ext4Error>
pub fn exists<'p, P>(&self, path: P) -> Result<bool, Ext4Error>
Check if path exists.
Returns Ok(true) if path exists, or Ok(false) if it does
not exist.
§Errors
An error will be returned if:
pathis not absolute.
This is not an exhaustive list of errors, see the crate documentation.
Sourcepub fn metadata<'p, P>(&self, path: P) -> Result<Metadata, Ext4Error>
pub fn metadata<'p, P>(&self, path: P) -> Result<Metadata, Ext4Error>
Get Metadata for path.
§Errors
An error will be returned if:
pathis not absolute.pathdoes not exist.
This is not an exhaustive list of errors, see the crate documentation.
Sourcepub fn symlink_metadata<'p, P>(&self, path: P) -> Result<Metadata, Ext4Error>
pub fn symlink_metadata<'p, P>(&self, path: P) -> Result<Metadata, Ext4Error>
Get Metadata for path.
If the final component of path is a symlink, information about
the symlink itself will be returned, not the symlink’s
targets. Any other symlink components of path are resolved as
normal.
§Errors
An error will be returned if:
pathis not absolute.pathdoes not exist.
This is not an exhaustive list of errors, see the crate documentation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ext4
impl !RefUnwindSafe for Ext4
impl !Send for Ext4
impl !Sync for Ext4
impl Unpin for Ext4
impl !UnwindSafe for Ext4
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)