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

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]

[src]

Deprecated

: Use with_content

Creates a new ID3v2.3 frame with the specified identifier.

Panics

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

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

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

[src]

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

[src]

Returns the content of the frame.

[src]

Returns whether the tag_alter_preservation flag is set.

[src]

Sets the tag_alter_preservation flag.

[src]

Returns whether the file_alter_preservation flag is set.

[src]

Sets the file_alter_preservation flag.

[src]

Deprecated

: Format using fmt::Display

Returns a string representing the parsed content.

Returns None if the parsed content can not be represented as text.

Example

use id3::frame::{self, Frame, Content};

let title_frame = Frame::with_content("TIT2", Content::Text("title".to_owned()));
assert_eq!(&title_frame.text().unwrap()[..], "title");

let mut txxx_frame = Frame::with_content("TXXX", Content::ExtendedText(frame::ExtendedText {
    description: "description".to_owned(),
    value: "value".to_owned()
}));
assert_eq!(&txxx_frame.text().unwrap()[..], "description: value");

Trait Implementations

impl Clone for Frame
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Frame
[src]

[src]

Formats the value using the given formatter.

impl Eq for Frame
[src]

impl PartialEq for Frame
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Hash for Frame
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

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

impl Display for Frame
[src]

[src]

Formats the value using the given formatter. Read more