pub struct ContentMetadata {
pub name: String,
pub mime_type: Option<String>,
pub len: Option<u64>,
pub modified_millis: Option<u64>,
pub identifier: String,
}Expand description
Everything a provider can state about a piece of content without reading it.
Fields§
§name: StringDisplay name, usually the last path or URI component.
mime_type: Option<String>MIME type when the provider reports one.
len: Option<u64>Byte length when the provider reports one.
modified_millis: Option<u64>Last-modified time in milliseconds since the Unix epoch, when known.
identifier: StringProvider-scoped identifier: a path, a content:// URI, a blob name.
Not guaranteed to be openable outside its provider.
Implementations§
Source§impl ContentMetadata
impl ContentMetadata
Sourcepub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
pub fn with_mime_type(self, mime_type: impl Into<String>) -> Self
Sets the MIME type.
Sourcepub fn with_modified_millis(self, modified_millis: u64) -> Self
pub fn with_modified_millis(self, modified_millis: u64) -> Self
Sets the last-modified time in milliseconds since the Unix epoch.
Sourcepub fn with_identifier(self, identifier: impl Into<String>) -> Self
pub fn with_identifier(self, identifier: impl Into<String>) -> Self
Sets the provider-scoped identifier.
Trait Implementations§
Source§impl Clone for ContentMetadata
impl Clone for ContentMetadata
Source§impl Debug for ContentMetadata
impl Debug for ContentMetadata
Source§impl Default for ContentMetadata
impl Default for ContentMetadata
impl Eq for ContentMetadata
Source§impl PartialEq for ContentMetadata
impl PartialEq for ContentMetadata
impl StructuralPartialEq for ContentMetadata
Auto Trait Implementations§
impl Freeze for ContentMetadata
impl RefUnwindSafe for ContentMetadata
impl Send for ContentMetadata
impl Sync for ContentMetadata
impl Unpin for ContentMetadata
impl UnsafeUnpin for ContentMetadata
impl UnwindSafe for ContentMetadata
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