pub struct MetaData { /* private fields */ }
Expand description
Represents the full metadata for a media file.
Implementations
sourceimpl MetaData
impl MetaData
sourcepub fn new(
title: &str,
author: &str,
entry_type: EntryType,
digest: RecordDigest,
filename: Option<FileName>
) -> MetaData
pub fn new(
title: &str,
author: &str,
entry_type: EntryType,
digest: RecordDigest,
filename: Option<FileName>
) -> MetaData
Create a new MetaData instance with basic data.
Arguments
title
- Maps to the DCMetaData::title field.author
- Maps to the DCMetaData::author field.entry_type
- Maps to the DCMetaData::typ field.digest
- The digest of the media file.filename
- The client’s optional local file name for the media.
sourcepub fn set_title(&mut self, title: &str)
pub fn set_title(&mut self, title: &str)
Set the DCMetaData::title value.
Set the DCMetaData::author value.
sourcepub fn set_fingerprint(&mut self, fingerprint: RecordDigest)
pub fn set_fingerprint(&mut self, fingerprint: RecordDigest)
Set the digest as digest::RecordDigest::Sha512 instance of the provided fingerprint.
sourcepub fn set_fingerprint_urn(&mut self, urn: &str)
pub fn set_fingerprint_urn(&mut self, urn: &str)
Set the digest from the given URN string.
The URN must specify a valid supported digest scheme.
sourcepub fn title(&self) -> String
pub fn title(&self) -> String
Returns the current DCMetaData::title value.
Returns the current DCMetaData::author value.
sourcepub fn set_typ(&mut self, typ: &str)
pub fn set_typ(&mut self, typ: &str)
Set the DCMetaData::typ value.
sourcepub fn typ(&self) -> EntryType
pub fn typ(&self) -> EntryType
Returns the current DCMetaData::typ value.
sourcepub fn set_subject(&mut self, v: &str)
pub fn set_subject(&mut self, v: &str)
Set the current DCMetaData::subject value.
sourcepub fn subject(&self) -> Option<String>
pub fn subject(&self) -> Option<String>
Returns the current DCMetaData::subject value.
sourcepub fn set_mime(&mut self, m: Mime)
pub fn set_mime(&mut self, m: Mime)
Set the current DCMetaData::mime value.
sourcepub fn set_mime_str(&mut self, s: &str)
pub fn set_mime_str(&mut self, s: &str)
Set the current DCMetaData::mime value from the given MIME identifier string.
sourcepub fn mime(&self) -> Option<Mime>
pub fn mime(&self) -> Option<Mime>
Returns the current DCMetaData::mime value.
sourcepub fn set_language(&mut self, s: &str)
pub fn set_language(&mut self, s: &str)
Set the current DCMetaData::language value.
sourcepub fn language(&self) -> Option<LanguageIdentifier>
pub fn language(&self) -> Option<LanguageIdentifier>
Returns the current DCMetaData::language value.
sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
sourcepub fn from_xattr(filepath: &Path) -> Result<MetaData, ParseError>
pub fn from_xattr(filepath: &Path) -> Result<MetaData, ParseError>
Instantiate metadata from the extended attributes of the file in filepath
.
sourcepub fn to_xattr(&self, filepath: &Path) -> Result<(), Error>
pub fn to_xattr(&self, filepath: &Path) -> Result<(), Error>
Applies the metadata as extended file attributes of the file in filepath
.
Will always export:
Will export, if defined:
sourcepub fn set_mime_magic(&mut self, path: &Path)
pub fn set_mime_magic(&mut self, path: &Path)
Automatically detect media type of file in path
.
sourcepub fn from_path(p: &Path) -> Result<MetaData, Error>
pub fn from_path(p: &Path) -> Result<MetaData, Error>
Parse metadata from simplified metadata format contained in file in path
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for MetaData
impl Send for MetaData
impl Sync for MetaData
impl Unpin for MetaData
impl UnwindSafe for MetaData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more