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]

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 unicode
  • path 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]

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

impl Default for Tag[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.