[][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.

Trait Implementations

impl Eq for Frame[src]

impl Clone for Frame[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq<Frame> for Frame[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Hash for Frame[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Frame[src]

impl Display for Frame[src]

Auto Trait Implementations

impl Send for Frame

impl Sync for Frame

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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