Struct lofty::Tag [−][src]
pub struct Tag(_);
Expand description
A builder for Box<dyn AudioTag>
. If you do not want a trait object, you can use individual types.
Implementations
impl Tag
[src]
impl Tag
[src]pub fn with_tag_type(self, tag_type: TagType) -> Self
[src]
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]
pub fn read_from_path(
&self,
path: impl AsRef<Path>
) -> Result<Box<dyn AudioTag>>
[src]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]
pub fn read_from_path_signature(
&self,
path: impl AsRef<Path>
) -> Result<Box<dyn AudioTag>>
[src]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.