Struct id3::Encoder [−][src]
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
Auto Trait Implementations
impl RefUnwindSafe for Encoder
[src]
impl Send for Encoder
[src]
impl Sync for Encoder
[src]
impl Unpin for Encoder
[src]
impl UnwindSafe for Encoder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,