pub struct File {
pub path: PathBuf,
pub uid: u32,
pub gid: u32,
pub mode: String,
pub size: u64,
pub time: i64,
pub md5_digest: Option<Md5Checksum>,
pub sha256_digest: Sha256Checksum,
}
Expand description
A file type path statement in an mtree file.
The md5_digest is accepted for backwards compatibility reasons in v2 as well.
Fields§
§path: PathBuf
The path of the file.
uid: u32
The user ID of the file.
gid: u32
The group ID of the file.
mode: String
The file mode of the file.
size: u64
The size of the file in bytes.
time: i64
The modification time of the file in seconds since the epoch.
md5_digest: Option<Md5Checksum>
The optional MD-5 hash digest of the file.
sha256_digest: Sha256Checksum
The SHA-256 hash digest of the file.
Implementations§
Source§impl File
impl File
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 file,- the size of
InputPath::to_path_buf
matches that ofself.size
, - the SHA-256 hash digest of
InputPath::to_path_buf
matches that ofself.sha256_digest
, - 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 File
impl Ord for File
Source§impl PartialOrd for File
impl PartialOrd for File
impl Eq for File
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
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