pub struct Directory {
pub path: PathBuf,
pub uid: u32,
pub gid: u32,
pub mode: String,
pub time: i64,
}
Expand description
A directory type path statement in an mtree file.
Fields§
§path: PathBuf
The path of the directory.
uid: u32
The user ID of the directory.
gid: u32
The group ID of the directory.
mode: String
The file mode of the directory.
time: i64
The modification time of the directory in seconds since the epoch.
Implementations§
Source§impl Directory
impl Directory
Sourcepub fn equals_path(
&self,
input_path: &InputPath<'_, '_>,
) -> Result<(), Vec<PathValidationError>>
pub fn equals_path( &self, input_path: &InputPath<'_, '_>, ) -> Result<(), Vec<PathValidationError>>
Checks whether InputPath
equals self
.
More specifically, checks that
MTREE_PATH_PREFIX
can be stripped fromself.path
,InputPath::path
and the strippedself.path
match,InputPath::to_path_buf
exists,- metadata can be retrieved for
InputPath::to_path_buf
, InputPath::to_path_buf
is a directory,- the modification time of
InputPath::to_path_buf
matches that ofself.time
, - the UID of
InputPath::to_path_buf
matches that ofself.uid
, - the GID of
InputPath::to_path_buf
matches that ofself.gid
, - the mode of
InputPath::to_path_buf
matches that ofself.mode
.
§Errors
Returns a list of PathValidationError
s if issues have been found during validation of
input_path
.
Trait Implementations§
Source§impl Ord for Directory
impl Ord for Directory
Source§impl PartialOrd for Directory
impl PartialOrd for Directory
impl Eq for Directory
impl StructuralPartialEq for Directory
Auto Trait Implementations§
impl Freeze for Directory
impl RefUnwindSafe for Directory
impl Send for Directory
impl Sync for Directory
impl Unpin for Directory
impl UnwindSafe for Directory
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
Mutably borrows from an owned value. Read more