pub struct Metadata { /* private fields */ }Expand description
Metadata information about an entry.
§Examples
use libpna::Metadata;
use std::time::SystemTime;
let since_unix_epoch = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)?;
let metadata = Metadata::new()
.with_accessed(Some(since_unix_epoch))
.with_created(Some(since_unix_epoch))
.with_modified(Some(since_unix_epoch));Implementations§
Source§impl Metadata
impl Metadata
Sourcepub const fn with_created(self, created: Option<Duration>) -> Self
pub const fn with_created(self, created: Option<Duration>) -> Self
Set created time that as duration since unix epoch time.
§Examples
use libpna::Metadata;
use std::time::SystemTime;
let since_unix_epoch = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)?;
let metadata = Metadata::new().with_created(Some(since_unix_epoch));Sourcepub const fn with_modified(self, modified: Option<Duration>) -> Self
pub const fn with_modified(self, modified: Option<Duration>) -> Self
Set modified time that as duration since unix epoch time.
§Examples
use libpna::Metadata;
use std::time::SystemTime;
let since_unix_epoch = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)?;
let metadata = Metadata::new().with_modified(Some(since_unix_epoch));Sourcepub const fn with_accessed(self, accessed: Option<Duration>) -> Self
pub const fn with_accessed(self, accessed: Option<Duration>) -> Self
Set accessed time that as duration since unix epoch time.
§Examples
use libpna::Metadata;
use std::time::SystemTime;
let since_unix_epoch = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)?;
let metadata = Metadata::new().with_accessed(Some(since_unix_epoch));Sourcepub fn with_permission(self, permission: Option<Permission>) -> Self
pub fn with_permission(self, permission: Option<Permission>) -> Self
Set permission of entry.
Sourcepub const fn raw_file_size(&self) -> Option<u128>
pub const fn raw_file_size(&self) -> Option<u128>
Raw file size of entry data in bytes
Sourcepub const fn compressed_size(&self) -> usize
pub const fn compressed_size(&self) -> usize
Compressed size of entry data in bytes
Sourcepub const fn permission(&self) -> Option<&Permission>
pub const fn permission(&self) -> Option<&Permission>
An owner, group, and permissions for an entry
Trait Implementations§
Source§impl Ord for Metadata
impl Ord for Metadata
Source§impl PartialOrd for Metadata
impl PartialOrd for Metadata
impl Eq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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