Struct id3::frame::Frame

source · []
pub struct Frame { /* private fields */ }
Expand description

A structure representing an ID3 frame.

The Content must be accompanied by a matching ID. Although this struct allows for invalid combinations to exist, attempting to encode them will yield an error.

Implementations

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.

Creates a new text frame with the specified ID and text content.

This function does not verify whether the ID is valid for text frames.

Example
use id3::Frame;

let frame = Frame::text("TPE1", "Armin van Buuren");
assert_eq!(frame.content().text(), Some("Armin van Buuren"));

Creates a new link frame with the specified ID and link content.

This function does not verify whether the ID is valid for link frames.

Example
use id3::Frame;

let frame = Frame::link("WCOM", "https://wwww.arminvanbuuren.com");
assert_eq!(frame.content().link(), Some("https://wwww.arminvanbuuren.com"));

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.

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

Returns the content of the frame.

Returns whether the tag_alter_preservation flag is set.

Sets the tag_alter_preservation flag.

Returns whether the file_alter_preservation flag is set.

Sets the file_alter_preservation flag.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Extends a collection with the contents of an iterator. Read more

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

Extends a collection with exactly one element.

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

Reserves capacity in a collection for the given number of additional elements. Read more

Extends a collection with the contents of an iterator. Read more

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

Extends a collection with exactly one element.

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

Reserves capacity in a collection for the given number of additional elements. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Creates a value from an iterator. Read more

Feeds this value into the given Hasher. Read more

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

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.