pub struct Link {
pub path: PathBuf,
pub uid: u32,
pub gid: u32,
pub mode: String,
pub time: i64,
pub link_path: PathBuf,
}
Expand description
A link type path in an mtree file that points to a file somewhere on the system.
Fields§
§path: PathBuf
The path of the symlink.
uid: u32
The user ID of the symlink.
gid: u32
The group ID of the symlink.
mode: String
The file mode of the symlink.
time: i64
The modification time of the symlink in seconds since the epoch.
link_path: PathBuf
The target path of the symlink.
Implementations§
Source§impl Link
impl Link
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 and is a symlink,- metadata can be retrieved for
InputPath::to_path_buf
, - the link path of
InputPath::to_path_buf
matches that ofself.link_path
, - 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 Link
impl Ord for Link
Source§impl PartialOrd for Link
impl PartialOrd for Link
impl Eq for Link
impl StructuralPartialEq for Link
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnwindSafe for Link
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