Struct lofty::TaggedFile
source · [−]pub struct TaggedFile { /* private fields */ }
Expand description
A generic representation of a file
This is used when the FileType
has to be guessed
Implementations
sourceimpl TaggedFile
impl TaggedFile
Returns all tags
sourcepub fn primary_tag_type(&self) -> TagType
pub fn primary_tag_type(&self) -> TagType
Returns the file type’s primary TagType
sourcepub fn supports_tag_type(&self, tag_type: TagType) -> bool
pub fn supports_tag_type(&self, tag_type: TagType) -> bool
Determines whether the file supports the given TagType
sourcepub fn tag_mut(&mut self, tag_type: &TagType) -> Option<&mut Tag>
pub fn tag_mut(&mut self, tag_type: &TagType) -> Option<&mut Tag>
Get a mutable reference to a specific TagType
sourcepub fn primary_tag(&self) -> Option<&Tag>
pub fn primary_tag(&self) -> Option<&Tag>
Returns the primary tag
sourcepub fn primary_tag_mut(&mut self) -> Option<&mut Tag>
pub fn primary_tag_mut(&mut self) -> Option<&mut Tag>
Gets a mutable reference to the file’s “Primary tag”
sourcepub fn first_tag_mut(&mut self) -> Option<&mut Tag>
pub fn first_tag_mut(&mut self) -> Option<&mut Tag>
Gets a mutable reference to the first tag, if there are any
sourcepub fn insert_tag(&mut self, tag: Tag) -> Option<Tag>
pub fn insert_tag(&mut self, tag: Tag) -> Option<Tag>
Inserts a Tag
NOTE: This will do nothing if the FileType
does not support
the TagType
. See FileType::supports_tag_type
If a tag is replaced, it will be returned
sourcepub fn take(&mut self, tag_type: TagType) -> Option<Tag>
pub fn take(&mut self, tag_type: TagType) -> Option<Tag>
Removes a specific TagType
and returns it
sourcepub fn change_file_type(&mut self, file_type: FileType)
pub fn change_file_type(&mut self, file_type: FileType)
Changes the FileType
NOTES:
- This will remove any tag the format does not support. See
FileType::supports_tag_type
- This will reset the
FileProperties
Trait Implementations
sourceimpl AudioFile for TaggedFile
impl AudioFile for TaggedFile
type Properties = FileProperties
type Properties = FileProperties
The struct the file uses for audio properties Read more
sourcefn read_from<R>(reader: &mut R, read_properties: bool) -> Result<Self> where
R: Read + Seek,
Self: Sized,
fn read_from<R>(reader: &mut R, read_properties: bool) -> Result<Self> where
R: Read + Seek,
Self: Sized,
Read a file from a reader Read more
sourcefn properties(&self) -> &Self::Properties
fn properties(&self) -> &Self::Properties
Returns a reference to the file’s properties
sourcefn contains_tag(&self) -> bool
fn contains_tag(&self) -> bool
Checks if the file contains any tags
sourcefn contains_tag_type(&self, tag_type: TagType) -> bool
fn contains_tag_type(&self, tag_type: TagType) -> bool
Checks if the file contains the given TagType
sourceimpl From<AiffFile> for TaggedFile
impl From<AiffFile> for TaggedFile
sourceimpl From<ApeFile> for TaggedFile
impl From<ApeFile> for TaggedFile
sourceimpl From<FlacFile> for TaggedFile
impl From<FlacFile> for TaggedFile
sourceimpl From<Mp3File> for TaggedFile
impl From<Mp3File> for TaggedFile
sourceimpl From<Mp4File> for TaggedFile
impl From<Mp4File> for TaggedFile
sourceimpl From<OpusFile> for TaggedFile
impl From<OpusFile> for TaggedFile
sourceimpl From<SpeexFile> for TaggedFile
impl From<SpeexFile> for TaggedFile
sourceimpl From<VorbisFile> for TaggedFile
impl From<VorbisFile> for TaggedFile
sourcefn from(input: VorbisFile) -> Self
fn from(input: VorbisFile) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for TaggedFile
impl Send for TaggedFile
impl Sync for TaggedFile
impl Unpin for TaggedFile
impl UnwindSafe for TaggedFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more