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 padding(self, padding: usize) -> Self
[src]
Sets the padding that is written after the tag.
Should be only used when writing to a MP3 file
pub fn version(self, version: Version) -> Self
[src]
Sets the ID3 version.
pub fn unsynchronisation(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(self, compression: bool) -> Self
[src]
Enables or disables compression.
pub fn file_altered(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, 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
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
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>,