#[non_exhaustive]pub struct FileMetadata { /* private fields */ }Expand description
Stable and extensible metadata for one filesystem resource.
§Examples
use qubit_fs::metadata::{FileKind, FileMetadata};
let metadata = FileMetadata::new(FileKind::File).with_len(Some(42));
assert_eq!(Some(42), metadata.len());Implementations§
Source§impl FileMetadata
impl FileMetadata
Sourcepub const fn kind(&self) -> &FileKind
pub const fn kind(&self) -> &FileKind
Returns the provider-neutral resource kind.
§Returns
The resource kind borrowed from this metadata snapshot.
Sourcepub const fn len(&self) -> Option<u64>
pub const fn len(&self) -> Option<u64>
Returns the known byte length, if any.
§Returns
Some with the byte length when known, or None otherwise.
Sourcepub const fn modified_at(&self) -> Option<SystemTime>
pub const fn modified_at(&self) -> Option<SystemTime>
Returns the last modification time, if known.
§Returns
Some with the modification time when known, or None otherwise.
Sourcepub const fn created_at(&self) -> Option<SystemTime>
pub const fn created_at(&self) -> Option<SystemTime>
Returns the creation time, if known.
§Returns
Some with the creation time when known, or None otherwise.
Sourcepub const fn accessed_at(&self) -> Option<SystemTime>
pub const fn accessed_at(&self) -> Option<SystemTime>
Returns the last access time, if known.
§Returns
Some with the access time when known, or None otherwise.
Sourcepub const fn etag(&self) -> Option<&ResourceVersion>
pub const fn etag(&self) -> Option<&ResourceVersion>
Returns the provider version or ETag, if known.
§Returns
Some with the version borrowed from this snapshot, or None when the
provider did not report one.
Sourcepub fn content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
Returns the content type, if known.
§Returns
Some with the content type borrowed from this snapshot, or None when
the provider did not report one.
Sourcepub const fn checksum(&self) -> Option<&Checksum>
pub const fn checksum(&self) -> Option<&Checksum>
Returns the content checksum, if known.
§Returns
Some with the checksum borrowed from this snapshot, or None when the
provider did not report one.
Sourcepub const fn user_metadata(&self) -> &NonSensitiveMetadata
pub const fn user_metadata(&self) -> &NonSensitiveMetadata
Returns validated user-defined metadata.
§Returns
The validated metadata borrowed from this snapshot.
Sourcepub const fn provider_metadata(&self) -> &NonSensitiveMetadata
pub const fn provider_metadata(&self) -> &NonSensitiveMetadata
Returns validated provider-native metadata.
§Returns
The validated metadata borrowed from this snapshot.
Sourcepub fn is_directory_like(&self) -> bool
pub fn is_directory_like(&self) -> bool
Tells whether this metadata describes a directory-like resource.
§Returns
true for directories and prefixes.
Sourcepub fn is_file_like(&self) -> bool
pub fn is_file_like(&self) -> bool
Tells whether this metadata describes a file-like resource.
§Returns
true for regular files and object-store objects.