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 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.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
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
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Creates a value from an iterator. Read more
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
Auto Trait Implementations
impl RefUnwindSafe for Frame
impl UnwindSafe for Frame
Blanket Implementations
Mutably borrows from an owned value. Read more