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: PathBufThe path of the file.
uid: u32The user ID of the file.
gid: u32The group ID of the file.
mode: StringThe file mode of the file.
size: u64The size of the file in bytes.
time: i64The 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: Sha256ChecksumThe 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_PREFIXcan be stripped fromself.path,InputPath::pathand the strippedself.pathmatch,InputPath::to_path_bufexists,- metadata can be retrieved for
InputPath::to_path_buf, InputPath::to_path_bufis a file,- the size of
InputPath::to_path_bufmatches that ofself.size, - the SHA-256 hash digest of
InputPath::to_path_bufmatches that ofself.sha256_digest, - the modification time of
InputPath::to_path_bufmatches that ofself.time, - the UID of
InputPath::to_path_bufmatches that ofself.uid, - the GID of
InputPath::to_path_bufmatches that ofself.gid, - the mode of
InputPath::to_path_bufmatches that ofself.mode.
§Errors
Returns a list of PathValidationErrors 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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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