Struct id3::Encoder[][src]

pub struct Encoder { /* fields omitted */ }

The Encoder may be used to encode tags.

Implementations

impl Encoder[src]

pub fn new() -> Self[src]

Constructs a new Encoder with the following configuration:

  • version is ID3v2.4
  • unsynchronization is disabled due to compatibility issues
  • no compression
  • file is not marked as altered

pub fn version(mut self: Self, version: Version) -> Self[src]

Sets the ID3 version.

pub fn unsynchronisation(mut self: Self, unsynchronisation: bool) -> Self[src]

Enables or disables the unsynchronisation scheme.

This avoids patterns that resemble MP3-frame headers from being encoded. If you are encoding to MP3 files and wish to be compatible with very old tools, you probably want this enabled.

pub fn compression(mut self: Self, compression: bool) -> Self[src]

Enables or disables compression.

pub fn file_altered(mut self: Self, file_altered: bool) -> Self[src]

Informs the encoder whether the file this tag belongs to has been changed.

This subsequently discards any tags that have their File Alter Preservation bits set and that have a relation to the file contents:

AENC, ETCO, EQUA, MLLT, POSS, SYLT, SYTC, RVAD, TENC, TLEN, TSIZ

pub fn encode(&self, tag: &Tag, mut writer: impl Write) -> Result<()>[src]

Encodes the specified tag using the settings set in the encoder.

Note that the plain tag is written, regardless of the original contents. To safely encode a tag to an MP3 file, use Encoder::encode_to_path.

pub fn encode_to_path(&self, tag: &Tag, path: impl AsRef<Path>) -> Result<()>[src]

Encodes a tag and replaces any existing tag in the file pointed to by the specified path.

Trait Implementations

impl Clone for Encoder[src]

impl Debug for Encoder[src]

impl Default for Encoder[src]

Auto Trait Implementations

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