[][src]Struct id3::frame::Frame

pub struct Frame { /* fields omitted */ }

A structure representing an ID3 frame.

It is imporant to note that the (Partial)Eq and Hash implementations are based on the ID3 spec. This means that text frames with equal ID's are equal but picture frames with both "APIC" as ID are not because their uniqueness is also defined by their content.

Methods

impl Frame[src]

pub fn with_content(id: impl AsRef<str>, content: Content) -> Frame[src]

Creates a frame with the specified ID and content.

Both ID3v2.2 and >ID3v2.3 IDs are accepted, although they will be converted to ID3v2.3 format. If an ID3v2.2 ID is supplied but could not be remapped, it is stored as-is.

Panics

If the id's length is not 3 or 4 bytes long.

pub fn id(&self) -> &str[src]

Returns the ID of this frame.

The string returned us usually 4 bytes long except when the frame was read from an ID3v2.2 tag and the ID could not be mapped to an ID3v2.3 ID.

pub fn id_for_version(&self, version: Version) -> Option<&str>[src]

Returns the ID that is compatible with specified version or None if no ID is available in that version.

pub fn content(&self) -> &Content[src]

Returns the content of the frame.

pub fn tag_alter_preservation(&self) -> bool[src]

Returns whether the tag_alter_preservation flag is set.

pub fn set_tag_alter_preservation(&mut self, tag_alter_preservation: bool)[src]

Sets the tag_alter_preservation flag.

pub fn file_alter_preservation(&self) -> bool[src]

Returns whether the file_alter_preservation flag is set.

pub fn set_file_alter_preservation(&mut self, file_alter_preservation: bool)[src]

Sets the file_alter_preservation flag.

pub fn name(&self) -> &str[src]

Returns the name of the frame.

The name is the human-readable representation of a frame id. For example, the id "TCOM" corresponds to the name "Composer". The names are taken from the ID3v2.4, ID3v2.3 and ID3v2.2 standards.

Trait Implementations

impl Clone for Frame[src]

impl Debug for Frame[src]

impl Display for Frame[src]

impl Eq for Frame[src]

impl Hash for Frame[src]

impl PartialEq<Frame> for Frame[src]

impl StructuralEq for Frame[src]

Auto Trait Implementations

impl RefUnwindSafe for Frame

impl Send for Frame

impl Sync for Frame

impl Unpin for Frame

impl UnwindSafe for Frame

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.