pub struct Comments { /* private fields */ }
Expand description
Comments to be attached to an Ogg Opus file.
Can contain metadata in VorbisComment format and images.
§Example
use opusenc::{Comments, PicardTag, RecommendedTag};
let comments = Comments::create()
.add(RecommendedTag::Title, "The Hardest Button to Button")?
.add(RecommendedTag::Artist, "The White Stripes")?
.add(RecommendedTag::Album, "Elephant")?
.add(RecommendedTag::TrackNumber, "9")?
.add(PicardTag::AlbumArtist, "The White Stripes")?
.add(RecommendedTag::Isrc, "USVT10300009")?;
Implementations§
Source§impl Comments
impl Comments
Sourcepub fn add(
&mut self,
tag: impl AsRef<CStr>,
val: impl Into<Vec<u8>>,
) -> Result<&mut Self>
pub fn add( &mut self, tag: impl AsRef<CStr>, val: impl Into<Vec<u8>>, ) -> Result<&mut Self>
Add a comment.
For common tags, see RecommendedTag
and PicardTag
.
Tag names must not contain the =
charater.
Sourcepub fn add_string(
&mut self,
tag_and_val: impl Into<Vec<u8>>,
) -> Result<&mut Self>
pub fn add_string( &mut self, tag_and_val: impl Into<Vec<u8>>, ) -> Result<&mut Self>
Add a comment as a single tag=value string.
The string must contain the =
character.
Sourcepub fn add_picture(
&mut self,
filename: impl AsRef<Path>,
picture_type: PictureType,
description: Option<impl Into<Vec<u8>>>,
) -> Result<&mut Self>
pub fn add_picture( &mut self, filename: impl AsRef<Path>, picture_type: PictureType, description: Option<impl Into<Vec<u8>>>, ) -> Result<&mut Self>
Add a picture from a file.
Sourcepub fn add_picture_from_memory(
&mut self,
picture: impl AsRef<[u8]>,
picture_type: PictureType,
description: Option<impl Into<Vec<u8>>>,
) -> Result<&mut Self>
pub fn add_picture_from_memory( &mut self, picture: impl AsRef<[u8]>, picture_type: PictureType, description: Option<impl Into<Vec<u8>>>, ) -> Result<&mut Self>
Add a picture already in memory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Comments
impl RefUnwindSafe for Comments
impl !Send for Comments
impl !Sync for Comments
impl Unpin for Comments
impl UnwindSafe for Comments
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more