Struct lofty::Tag [−][src]
pub struct Tag(_);
A builder for Box<dyn AudioTag>
. If you do not want a trait object, you can use individual types.
Implementations
impl Tag
[src]
pub fn new() -> Self
[src]
Initiate a new Tag
pub fn with_tag_type(self, tag_type: TagType) -> Self
[src]
This function can be used to specify a TagType
, so there’s no guessing
pub fn read_from_path(
&self,
path: impl AsRef<Path>
) -> Result<Box<dyn AudioTag>>
[src]
&self,
path: impl AsRef<Path>
) -> Result<Box<dyn AudioTag>>
Attempts to get the tag format based on the file extension
NOTE: Since this only looks at the extension, the result could be incorrect.
Errors
path
either has no extension, or the extension is not valid unicodepath
has an unsupported/unknown extension
Warning
Using this on a wav
/wave
/riff
file will always assume there’s an ID3 tag.
read_from_path_signature
is recommended, in the event that a RIFF INFO list is present instead.
pub fn read_from_path_signature(
&self,
path: impl AsRef<Path>
) -> Result<Box<dyn AudioTag>>
[src]
&self,
path: impl AsRef<Path>
) -> Result<Box<dyn AudioTag>>
Attempts to get the tag format based on the file signature
NOTE: This is slightly slower than reading from extension, but more accurate. The only times were this would really be necessary is if the file format being read supports more than one metadata format (ex. RIFF), or there is no file extension.
Errors
path
does not exist- The tag is non-existent/invalid/unknown
Warning
In the event that a riff file contains both an ID3 tag and a RIFF INFO chunk, the ID3 tag will always be chosen.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,