Struct lofty::file::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§
source§impl TaggedFile
impl TaggedFile
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
§Examples
use lofty::file::{AudioFile, FileType, TaggedFileExt};
use lofty::tag::TagType;
// Read an MP3 file containing an ID3v2 tag
let mut tagged_file = lofty::read_from_path(path_to_mp3)?;
assert!(tagged_file.contains_tag_type(TagType::Id3v2));
// Remap our MP3 file to WavPack, which doesn't support ID3v2
tagged_file.change_file_type(FileType::WavPack);
assert!(!tagged_file.contains_tag_type(TagType::Id3v2));Trait Implementations§
source§impl AudioFile for TaggedFile
impl AudioFile for TaggedFile
§type Properties = FileProperties
type Properties = FileProperties
The struct the file uses for audio properties Read more
source§fn read_from<R>(reader: &mut R, parse_options: ParseOptions) -> Result<Self>
fn read_from<R>(reader: &mut R, parse_options: ParseOptions) -> Result<Self>
Read a file from a reader Read more
source§fn save_to<F>(&self, file: &mut F, write_options: WriteOptions) -> Result<()>
fn save_to<F>(&self, file: &mut F, write_options: WriteOptions) -> Result<()>
Attempts to write all tags to a file Read more
source§fn properties(&self) -> &Self::Properties
fn properties(&self) -> &Self::Properties
Returns a reference to the file’s properties
source§fn contains_tag(&self) -> bool
fn contains_tag(&self) -> bool
Checks if the file contains any tags
source§fn contains_tag_type(&self, tag_type: TagType) -> bool
fn contains_tag_type(&self, tag_type: TagType) -> bool
Checks if the file contains the given
TagTypesource§fn save_to_path(
&self,
path: impl AsRef<Path>,
write_options: WriteOptions
) -> Result<()>
fn save_to_path( &self, path: impl AsRef<Path>, write_options: WriteOptions ) -> Result<()>
Attempts to write all tags to a path Read more
source§impl From<AacFile> for TaggedFile
impl From<AacFile> for TaggedFile
source§impl From<AiffFile> for TaggedFile
impl From<AiffFile> for TaggedFile
source§impl From<ApeFile> for TaggedFile
impl From<ApeFile> for TaggedFile
source§impl From<BoundTaggedFile> for TaggedFile
impl From<BoundTaggedFile> for TaggedFile
source§fn from(input: BoundTaggedFile) -> Self
fn from(input: BoundTaggedFile) -> Self
Converts to this type from the input type.
source§impl From<FlacFile> for TaggedFile
impl From<FlacFile> for TaggedFile
source§impl From<Mp4File> for TaggedFile
impl From<Mp4File> for TaggedFile
source§impl From<MpcFile> for TaggedFile
impl From<MpcFile> for TaggedFile
source§impl From<MpegFile> for TaggedFile
impl From<MpegFile> for TaggedFile
source§impl From<OpusFile> for TaggedFile
impl From<OpusFile> for TaggedFile
source§impl From<SpeexFile> for TaggedFile
impl From<SpeexFile> for TaggedFile
source§impl From<VorbisFile> for TaggedFile
impl From<VorbisFile> for TaggedFile
source§fn from(input: VorbisFile) -> Self
fn from(input: VorbisFile) -> Self
Converts to this type from the input type.
source§impl From<WavFile> for TaggedFile
impl From<WavFile> for TaggedFile
source§impl From<WavPackFile> for TaggedFile
impl From<WavPackFile> for TaggedFile
source§fn from(input: WavPackFile) -> Self
fn from(input: WavPackFile) -> Self
Converts to this type from the input type.
source§impl TaggedFileExt for TaggedFile
impl TaggedFileExt for TaggedFile
Returns all tags Read more
source§fn first_tag_mut(&mut self) -> Option<&mut Tag>
fn first_tag_mut(&mut self) -> Option<&mut Tag>
Gets a mutable reference to the first tag, if there are any Read more
source§fn supports_tag_type(&self, tag_type: TagType) -> bool
fn supports_tag_type(&self, tag_type: TagType) -> bool
Auto Trait Implementations§
impl Freeze for TaggedFile
impl RefUnwindSafe for TaggedFile
impl Send for TaggedFile
impl Sync for TaggedFile
impl Unpin for TaggedFile
impl UnwindSafe for TaggedFile
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