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 named(name: impl Into<String>) -> ContentMetadata
pub fn named(name: impl Into<String>) -> ContentMetadata
Metadata carrying only a display name.
Sourcepub fn with_mime_type(self, mime_type: impl Into<String>) -> ContentMetadata
pub fn with_mime_type(self, mime_type: impl Into<String>) -> ContentMetadata
Sets the MIME type.
Sourcepub fn with_len(self, len: u64) -> ContentMetadata
pub fn with_len(self, len: u64) -> ContentMetadata
Sets the byte length.
Sourcepub fn with_modified_millis(self, modified_millis: u64) -> ContentMetadata
pub fn with_modified_millis(self, modified_millis: u64) -> ContentMetadata
Sets the last-modified time in milliseconds since the Unix epoch.
Sourcepub fn with_identifier(self, identifier: impl Into<String>) -> ContentMetadata
pub fn with_identifier(self, identifier: impl Into<String>) -> ContentMetadata
Sets the provider-scoped identifier.
Trait Implementations§
Source§impl Clone for ContentMetadata
impl Clone for ContentMetadata
Source§fn clone(&self) -> ContentMetadata
fn clone(&self) -> ContentMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContentMetadata
impl Debug for ContentMetadata
Source§impl Default for ContentMetadata
impl Default for ContentMetadata
Source§fn default() -> ContentMetadata
fn default() -> ContentMetadata
Returns the “default value” for a type. Read more
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.