pub struct Tag {
pub ftyp: String,
pub info: AudioInfo,
pub userdata: Userdata,
}Expand description
A tag containing MPEG-4 audio metadata.
Fields§
§ftyp: StringThe filetype (ftyp) atom.
info: AudioInfo§userdata: UserdataImplementations§
Source§impl Tag
§Audio information
impl Tag
§Audio information
Sourcepub fn audio_info(&self) -> &AudioInfo
pub fn audio_info(&self) -> &AudioInfo
Returns a reference of the audio information.
Sourcepub fn channel_config(&self) -> Option<ChannelConfig>
pub fn channel_config(&self) -> Option<ChannelConfig>
Returns the channel configuration.
Sourcepub fn sample_rate(&self) -> Option<SampleRate>
pub fn sample_rate(&self) -> Option<SampleRate>
Returns the channel configuration.
Sourcepub fn avg_bitrate(&self) -> Option<u32>
pub fn avg_bitrate(&self) -> Option<u32>
Returns the average bitrate.
Sourcepub fn max_bitrate(&self) -> Option<u32>
pub fn max_bitrate(&self) -> Option<u32>
Returns the maximum bitrate.
Source§impl Tag
impl Tag
Sourcepub fn read_with(
reader: &mut (impl Read + Seek),
cfg: &ReadConfig,
) -> Result<Self>
pub fn read_with( reader: &mut (impl Read + Seek), cfg: &ReadConfig, ) -> Result<Self>
Attempts to read a MPEG-4 audio tag from the reader.
Sourcepub fn read_from(reader: &mut (impl Read + Seek)) -> Result<Self>
pub fn read_from(reader: &mut (impl Read + Seek)) -> Result<Self>
Attempts to read a MPEG-4 audio tag from the reader.
Sourcepub fn read_with_path(path: impl AsRef<Path>, cfg: &ReadConfig) -> Result<Self>
pub fn read_with_path(path: impl AsRef<Path>, cfg: &ReadConfig) -> Result<Self>
Attempts to read a MPEG-4 audio tag from the file at the indicated path.
Sourcepub fn read_from_path(path: impl AsRef<Path>) -> Result<Self>
pub fn read_from_path(path: impl AsRef<Path>) -> Result<Self>
Attempts to read a MPEG-4 audio tag from the file at the indicated path.
Methods from Deref<Target = Userdata>§
Sourcepub fn take_album(&mut self) -> Option<String>
pub fn take_album(&mut self) -> Option<String>
Removes and returns the album (©alb).
Sourcepub fn remove_album(&mut self)
pub fn remove_album(&mut self)
Removes the album (©alb).
Sourcepub fn take_copyright(&mut self) -> Option<String>
pub fn take_copyright(&mut self) -> Option<String>
Removes and returns the copyright (cprt).
Sourcepub fn set_copyright(&mut self, copyright: impl Into<String>)
pub fn set_copyright(&mut self, copyright: impl Into<String>)
Sets the copyright (cprt).
Sourcepub fn remove_copyright(&mut self)
pub fn remove_copyright(&mut self)
Removes the copyright (cprt).
Sourcepub fn take_encoder(&mut self) -> Option<String>
pub fn take_encoder(&mut self) -> Option<String>
Removes and returns the encoder (©too).
Sourcepub fn set_encoder(&mut self, encoder: impl Into<String>)
pub fn set_encoder(&mut self, encoder: impl Into<String>)
Sets the encoder (©too).
Sourcepub fn remove_encoder(&mut self)
pub fn remove_encoder(&mut self)
Removes the encoder (©too).
Sourcepub fn take_lyrics(&mut self) -> Option<String>
pub fn take_lyrics(&mut self) -> Option<String>
Removes and returns the lyrics (©lyr).
Sourcepub fn set_lyrics(&mut self, lyrics: impl Into<String>)
pub fn set_lyrics(&mut self, lyrics: impl Into<String>)
Sets the lyrics (©lyr).
Sourcepub fn remove_lyrics(&mut self)
pub fn remove_lyrics(&mut self)
Removes the lyrics (©lyr).
Sourcepub fn take_movement(&mut self) -> Option<String>
pub fn take_movement(&mut self) -> Option<String>
Removes and returns the movement (©mvn).
Sourcepub fn set_movement(&mut self, movement: impl Into<String>)
pub fn set_movement(&mut self, movement: impl Into<String>)
Sets the movement (©mvn).
Sourcepub fn remove_movement(&mut self)
pub fn remove_movement(&mut self)
Removes the movement (©mvn).
Sourcepub fn take_title(&mut self) -> Option<String>
pub fn take_title(&mut self) -> Option<String>
Removes and returns the title (©nam).
Sourcepub fn remove_title(&mut self)
pub fn remove_title(&mut self)
Removes the title (©nam).
Sourcepub fn tv_episode_name(&self) -> Option<&str>
pub fn tv_episode_name(&self) -> Option<&str>
Returns the tv episode name (tven).
Sourcepub fn take_tv_episode_name(&mut self) -> Option<String>
pub fn take_tv_episode_name(&mut self) -> Option<String>
Removes and returns the tv episode name (tven).
Sourcepub fn set_tv_episode_name(&mut self, tv_episode_name: impl Into<String>)
pub fn set_tv_episode_name(&mut self, tv_episode_name: impl Into<String>)
Sets the tv episode name (tven).
Sourcepub fn remove_tv_episode_name(&mut self)
pub fn remove_tv_episode_name(&mut self)
Removes the tv episode name (tven).
Sourcepub fn tv_network_name(&self) -> Option<&str>
pub fn tv_network_name(&self) -> Option<&str>
Returns the tv network name (tvnn).
Sourcepub fn take_tv_network_name(&mut self) -> Option<String>
pub fn take_tv_network_name(&mut self) -> Option<String>
Removes and returns the tv network name (tvnn).
Sourcepub fn set_tv_network_name(&mut self, tv_network_name: impl Into<String>)
pub fn set_tv_network_name(&mut self, tv_network_name: impl Into<String>)
Sets the tv network name (tvnn).
Sourcepub fn remove_tv_network_name(&mut self)
pub fn remove_tv_network_name(&mut self)
Removes the tv network name (tvnn).
Sourcepub fn tv_show_name(&self) -> Option<&str>
pub fn tv_show_name(&self) -> Option<&str>
Returns the tv show name (tvsh).
Sourcepub fn take_tv_show_name(&mut self) -> Option<String>
pub fn take_tv_show_name(&mut self) -> Option<String>
Removes and returns the tv show name (tvsh).
Sourcepub fn set_tv_show_name(&mut self, tv_show_name: impl Into<String>)
pub fn set_tv_show_name(&mut self, tv_show_name: impl Into<String>)
Sets the tv show name (tvsh).
Sourcepub fn remove_tv_show_name(&mut self)
pub fn remove_tv_show_name(&mut self)
Removes the tv show name (tvsh).
Sourcepub fn remove_work(&mut self)
pub fn remove_work(&mut self)
Removes the work (©wrk).
Sourcepub fn remove_year(&mut self)
pub fn remove_year(&mut self)
Removes the year (©day).
Sourcepub fn take_isrc(&mut self) -> Option<String>
pub fn take_isrc(&mut self) -> Option<String>
Removes and returns the isrc (----:com.apple.iTunes:ISRC).
Sourcepub fn set_isrc(&mut self, isrc: impl Into<String>)
pub fn set_isrc(&mut self, isrc: impl Into<String>)
Sets the isrc (----:com.apple.iTunes:ISRC).
Sourcepub fn remove_isrc(&mut self)
pub fn remove_isrc(&mut self)
Removes the isrc (----:com.apple.iTunes:ISRC).
Sourcepub fn album_sort_order(&self) -> Option<&str>
pub fn album_sort_order(&self) -> Option<&str>
Returns the album sort order (soal).
Sourcepub fn take_album_sort_order(&mut self) -> Option<String>
pub fn take_album_sort_order(&mut self) -> Option<String>
Removes and returns the album sort order (soal).
Sourcepub fn set_album_sort_order(&mut self, album_sort_order: impl Into<String>)
pub fn set_album_sort_order(&mut self, album_sort_order: impl Into<String>)
Sets the album sort order (soal).
Sourcepub fn remove_album_sort_order(&mut self)
pub fn remove_album_sort_order(&mut self)
Removes the album sort order (soal).
Sourcepub fn title_sort_order(&self) -> Option<&str>
pub fn title_sort_order(&self) -> Option<&str>
Returns the title sort order (sonm).
Sourcepub fn take_title_sort_order(&mut self) -> Option<String>
pub fn take_title_sort_order(&mut self) -> Option<String>
Removes and returns the title sort order (sonm).
Sourcepub fn set_title_sort_order(&mut self, title_sort_order: impl Into<String>)
pub fn set_title_sort_order(&mut self, title_sort_order: impl Into<String>)
Sets the title sort order (sonm).
Sourcepub fn remove_title_sort_order(&mut self)
pub fn remove_title_sort_order(&mut self)
Removes the title sort order (sonm).
Sourcepub fn tv_show_name_sort_order(&self) -> Option<&str>
pub fn tv_show_name_sort_order(&self) -> Option<&str>
Returns the tv show name sort order (sosn).
Sourcepub fn take_tv_show_name_sort_order(&mut self) -> Option<String>
pub fn take_tv_show_name_sort_order(&mut self) -> Option<String>
Removes and returns the tv show name sort order (sosn).
Sourcepub fn set_tv_show_name_sort_order(
&mut self,
tv_show_name_sort_order: impl Into<String>,
)
pub fn set_tv_show_name_sort_order( &mut self, tv_show_name_sort_order: impl Into<String>, )
Sets the tv show name sort order (sosn).
Sourcepub fn remove_tv_show_name_sort_order(&mut self)
pub fn remove_tv_show_name_sort_order(&mut self)
Removes the tv show name sort order (sosn).
Sourcepub fn album_artists(&self) -> impl Iterator<Item = &str>
pub fn album_artists(&self) -> impl Iterator<Item = &str>
Returns all album artists (aART).
Sourcepub fn album_artist(&self) -> Option<&str>
pub fn album_artist(&self) -> Option<&str>
Returns the first album artist (aART).
Sourcepub fn take_album_artists(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_album_artists(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all album artists (aART).
Sourcepub fn take_album_artist(&mut self) -> Option<String>
pub fn take_album_artist(&mut self) -> Option<String>
Removes all and returns the first album artist (aART).
Sourcepub fn set_album_artists(
&mut self,
album_artists: impl IntoIterator<Item = String>,
)
pub fn set_album_artists( &mut self, album_artists: impl IntoIterator<Item = String>, )
Sets all album artists (aART). This will remove all other album artists.
Sourcepub fn set_album_artist(&mut self, album_artist: impl Into<String>)
pub fn set_album_artist(&mut self, album_artist: impl Into<String>)
Sets the album artist (aART). This will remove all other album artists.
Sourcepub fn add_album_artists(
&mut self,
album_artists: impl IntoIterator<Item = String>,
)
pub fn add_album_artists( &mut self, album_artists: impl IntoIterator<Item = String>, )
Adds all album artists (aART).
Sourcepub fn add_album_artist(&mut self, album_artist: impl Into<String>)
pub fn add_album_artist(&mut self, album_artist: impl Into<String>)
Adds an album artist (aART).
Sourcepub fn remove_album_artists(&mut self)
pub fn remove_album_artists(&mut self)
Removes all album artists (aART).
Sourcepub fn take_artists(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_artists(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all artists (©ART).
Sourcepub fn take_artist(&mut self) -> Option<String>
pub fn take_artist(&mut self) -> Option<String>
Removes all and returns the first artist (©ART).
Sourcepub fn set_artists(&mut self, artists: impl IntoIterator<Item = String>)
pub fn set_artists(&mut self, artists: impl IntoIterator<Item = String>)
Sets all artists (©ART). This will remove all other artists.
Sourcepub fn set_artist(&mut self, artist: impl Into<String>)
pub fn set_artist(&mut self, artist: impl Into<String>)
Sets the artist (©ART). This will remove all other artists.
Sourcepub fn add_artists(&mut self, artists: impl IntoIterator<Item = String>)
pub fn add_artists(&mut self, artists: impl IntoIterator<Item = String>)
Adds all artists (©ART).
Sourcepub fn add_artist(&mut self, artist: impl Into<String>)
pub fn add_artist(&mut self, artist: impl Into<String>)
Adds an artist (©ART).
Sourcepub fn remove_artists(&mut self)
pub fn remove_artists(&mut self)
Removes all artists (©ART).
Sourcepub fn categories(&self) -> impl Iterator<Item = &str>
pub fn categories(&self) -> impl Iterator<Item = &str>
Returns all categories (catg).
Sourcepub fn take_categories(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_categories(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all categories (catg).
Sourcepub fn take_category(&mut self) -> Option<String>
pub fn take_category(&mut self) -> Option<String>
Removes all and returns the first category (catg).
Sourcepub fn set_categories(&mut self, categories: impl IntoIterator<Item = String>)
pub fn set_categories(&mut self, categories: impl IntoIterator<Item = String>)
Sets all categories (catg). This will remove all other categories.
Sourcepub fn set_category(&mut self, category: impl Into<String>)
pub fn set_category(&mut self, category: impl Into<String>)
Sets the category (catg). This will remove all other categories.
Sourcepub fn add_categories(&mut self, categories: impl IntoIterator<Item = String>)
pub fn add_categories(&mut self, categories: impl IntoIterator<Item = String>)
Adds all categories (catg).
Sourcepub fn add_category(&mut self, category: impl Into<String>)
pub fn add_category(&mut self, category: impl Into<String>)
Adds an category (catg).
Sourcepub fn remove_categories(&mut self)
pub fn remove_categories(&mut self)
Removes all categories (catg).
Sourcepub fn take_comments(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_comments(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all comments (©cmt).
Sourcepub fn take_comment(&mut self) -> Option<String>
pub fn take_comment(&mut self) -> Option<String>
Removes all and returns the first comment (©cmt).
Sourcepub fn set_comments(&mut self, comments: impl IntoIterator<Item = String>)
pub fn set_comments(&mut self, comments: impl IntoIterator<Item = String>)
Sets all comments (©cmt). This will remove all other comments.
Sourcepub fn set_comment(&mut self, comment: impl Into<String>)
pub fn set_comment(&mut self, comment: impl Into<String>)
Sets the comment (©cmt). This will remove all other comments.
Sourcepub fn add_comments(&mut self, comments: impl IntoIterator<Item = String>)
pub fn add_comments(&mut self, comments: impl IntoIterator<Item = String>)
Adds all comments (©cmt).
Sourcepub fn add_comment(&mut self, comment: impl Into<String>)
pub fn add_comment(&mut self, comment: impl Into<String>)
Adds an comment (©cmt).
Sourcepub fn remove_comments(&mut self)
pub fn remove_comments(&mut self)
Removes all comments (©cmt).
Sourcepub fn take_composers(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_composers(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all composers (©wrt).
Sourcepub fn take_composer(&mut self) -> Option<String>
pub fn take_composer(&mut self) -> Option<String>
Removes all and returns the first composer (©wrt).
Sourcepub fn set_composers(&mut self, composers: impl IntoIterator<Item = String>)
pub fn set_composers(&mut self, composers: impl IntoIterator<Item = String>)
Sets all composers (©wrt). This will remove all other composers.
Sourcepub fn set_composer(&mut self, composer: impl Into<String>)
pub fn set_composer(&mut self, composer: impl Into<String>)
Sets the composer (©wrt). This will remove all other composers.
Sourcepub fn add_composers(&mut self, composers: impl IntoIterator<Item = String>)
pub fn add_composers(&mut self, composers: impl IntoIterator<Item = String>)
Adds all composers (©wrt).
Sourcepub fn add_composer(&mut self, composer: impl Into<String>)
pub fn add_composer(&mut self, composer: impl Into<String>)
Adds an composer (©wrt).
Sourcepub fn remove_composers(&mut self)
pub fn remove_composers(&mut self)
Removes all composers (©wrt).
Sourcepub fn custom_genres(&self) -> impl Iterator<Item = &str>
pub fn custom_genres(&self) -> impl Iterator<Item = &str>
Returns all custom genres (©gen).
Sourcepub fn custom_genre(&self) -> Option<&str>
pub fn custom_genre(&self) -> Option<&str>
Returns the first custom genre (©gen).
Sourcepub fn take_custom_genres(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_custom_genres(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all custom genres (©gen).
Sourcepub fn take_custom_genre(&mut self) -> Option<String>
pub fn take_custom_genre(&mut self) -> Option<String>
Removes all and returns the first custom genre (©gen).
Sourcepub fn set_custom_genres(
&mut self,
custom_genres: impl IntoIterator<Item = String>,
)
pub fn set_custom_genres( &mut self, custom_genres: impl IntoIterator<Item = String>, )
Sets all custom genres (©gen). This will remove all other custom genres.
Sourcepub fn set_custom_genre(&mut self, custom_genre: impl Into<String>)
pub fn set_custom_genre(&mut self, custom_genre: impl Into<String>)
Sets the custom genre (©gen). This will remove all other custom genres.
Sourcepub fn add_custom_genres(
&mut self,
custom_genres: impl IntoIterator<Item = String>,
)
pub fn add_custom_genres( &mut self, custom_genres: impl IntoIterator<Item = String>, )
Adds all custom genres (©gen).
Sourcepub fn add_custom_genre(&mut self, custom_genre: impl Into<String>)
pub fn add_custom_genre(&mut self, custom_genre: impl Into<String>)
Adds an custom genre (©gen).
Sourcepub fn remove_custom_genres(&mut self)
pub fn remove_custom_genres(&mut self)
Removes all custom genres (©gen).
Sourcepub fn descriptions(&self) -> impl Iterator<Item = &str>
pub fn descriptions(&self) -> impl Iterator<Item = &str>
Returns all descriptions (desc).
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Returns the first description (desc).
Sourcepub fn take_descriptions(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_descriptions(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all descriptions (desc).
Sourcepub fn take_description(&mut self) -> Option<String>
pub fn take_description(&mut self) -> Option<String>
Removes all and returns the first description (desc).
Sourcepub fn set_descriptions(
&mut self,
descriptions: impl IntoIterator<Item = String>,
)
pub fn set_descriptions( &mut self, descriptions: impl IntoIterator<Item = String>, )
Sets all descriptions (desc). This will remove all other descriptions.
Sourcepub fn set_description(&mut self, description: impl Into<String>)
pub fn set_description(&mut self, description: impl Into<String>)
Sets the description (desc). This will remove all other descriptions.
Sourcepub fn add_descriptions(
&mut self,
descriptions: impl IntoIterator<Item = String>,
)
pub fn add_descriptions( &mut self, descriptions: impl IntoIterator<Item = String>, )
Adds all descriptions (desc).
Sourcepub fn add_description(&mut self, description: impl Into<String>)
pub fn add_description(&mut self, description: impl Into<String>)
Adds an description (desc).
Sourcepub fn remove_descriptions(&mut self)
pub fn remove_descriptions(&mut self)
Removes all descriptions (desc).
Sourcepub fn take_groupings(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_groupings(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all groupings (©grp).
Sourcepub fn take_grouping(&mut self) -> Option<String>
pub fn take_grouping(&mut self) -> Option<String>
Removes all and returns the first grouping (©grp).
Sourcepub fn set_groupings(&mut self, groupings: impl IntoIterator<Item = String>)
pub fn set_groupings(&mut self, groupings: impl IntoIterator<Item = String>)
Sets all groupings (©grp). This will remove all other groupings.
Sourcepub fn set_grouping(&mut self, grouping: impl Into<String>)
pub fn set_grouping(&mut self, grouping: impl Into<String>)
Sets the grouping (©grp). This will remove all other groupings.
Sourcepub fn add_groupings(&mut self, groupings: impl IntoIterator<Item = String>)
pub fn add_groupings(&mut self, groupings: impl IntoIterator<Item = String>)
Adds all groupings (©grp).
Sourcepub fn add_grouping(&mut self, grouping: impl Into<String>)
pub fn add_grouping(&mut self, grouping: impl Into<String>)
Adds an grouping (©grp).
Sourcepub fn remove_groupings(&mut self)
pub fn remove_groupings(&mut self)
Removes all groupings (©grp).
Sourcepub fn take_keywords(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_keywords(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all keywords (keyw).
Sourcepub fn take_keyword(&mut self) -> Option<String>
pub fn take_keyword(&mut self) -> Option<String>
Removes all and returns the first keyword (keyw).
Sourcepub fn set_keywords(&mut self, keywords: impl IntoIterator<Item = String>)
pub fn set_keywords(&mut self, keywords: impl IntoIterator<Item = String>)
Sets all keywords (keyw). This will remove all other keywords.
Sourcepub fn set_keyword(&mut self, keyword: impl Into<String>)
pub fn set_keyword(&mut self, keyword: impl Into<String>)
Sets the keyword (keyw). This will remove all other keywords.
Sourcepub fn add_keywords(&mut self, keywords: impl IntoIterator<Item = String>)
pub fn add_keywords(&mut self, keywords: impl IntoIterator<Item = String>)
Adds all keywords (keyw).
Sourcepub fn add_keyword(&mut self, keyword: impl Into<String>)
pub fn add_keyword(&mut self, keyword: impl Into<String>)
Adds an keyword (keyw).
Sourcepub fn remove_keywords(&mut self)
pub fn remove_keywords(&mut self)
Removes all keywords (keyw).
Sourcepub fn lyricists(&self) -> impl Iterator<Item = &str>
pub fn lyricists(&self) -> impl Iterator<Item = &str>
Returns all lyricists (----:com.apple.iTunes:LYRICIST).
Sourcepub fn lyricist(&self) -> Option<&str>
pub fn lyricist(&self) -> Option<&str>
Returns the first lyricist (----:com.apple.iTunes:LYRICIST).
Sourcepub fn take_lyricists(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_lyricists(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all lyricists (----:com.apple.iTunes:LYRICIST).
Sourcepub fn take_lyricist(&mut self) -> Option<String>
pub fn take_lyricist(&mut self) -> Option<String>
Removes all and returns the first lyricist (----:com.apple.iTunes:LYRICIST).
Sourcepub fn set_lyricists(&mut self, lyricists: impl IntoIterator<Item = String>)
pub fn set_lyricists(&mut self, lyricists: impl IntoIterator<Item = String>)
Sets all lyricists (----:com.apple.iTunes:LYRICIST). This will remove all other lyricists.
Sourcepub fn set_lyricist(&mut self, lyricist: impl Into<String>)
pub fn set_lyricist(&mut self, lyricist: impl Into<String>)
Sets the lyricist (----:com.apple.iTunes:LYRICIST). This will remove all other lyricists.
Sourcepub fn add_lyricists(&mut self, lyricists: impl IntoIterator<Item = String>)
pub fn add_lyricists(&mut self, lyricists: impl IntoIterator<Item = String>)
Adds all lyricists (----:com.apple.iTunes:LYRICIST).
Sourcepub fn add_lyricist(&mut self, lyricist: impl Into<String>)
pub fn add_lyricist(&mut self, lyricist: impl Into<String>)
Adds an lyricist (----:com.apple.iTunes:LYRICIST).
Sourcepub fn remove_lyricists(&mut self)
pub fn remove_lyricists(&mut self)
Removes all lyricists (----:com.apple.iTunes:LYRICIST).
Sourcepub fn album_artist_sort_orders(&self) -> impl Iterator<Item = &str>
pub fn album_artist_sort_orders(&self) -> impl Iterator<Item = &str>
Returns all album artist sort orders (soaa).
Sourcepub fn album_artist_sort_order(&self) -> Option<&str>
pub fn album_artist_sort_order(&self) -> Option<&str>
Returns the first album artist sort order (soaa).
Sourcepub fn take_album_artist_sort_orders(
&mut self,
) -> impl Iterator<Item = String> + '_
pub fn take_album_artist_sort_orders( &mut self, ) -> impl Iterator<Item = String> + '_
Removes and returns all album artist sort orders (soaa).
Sourcepub fn take_album_artist_sort_order(&mut self) -> Option<String>
pub fn take_album_artist_sort_order(&mut self) -> Option<String>
Removes all and returns the first album artist sort order (soaa).
Sourcepub fn set_album_artist_sort_orders(
&mut self,
album_artist_sort_orders: impl IntoIterator<Item = String>,
)
pub fn set_album_artist_sort_orders( &mut self, album_artist_sort_orders: impl IntoIterator<Item = String>, )
Sets all album artist sort orders (soaa). This will remove all other album artist sort orders.
Sourcepub fn set_album_artist_sort_order(
&mut self,
album_artist_sort_order: impl Into<String>,
)
pub fn set_album_artist_sort_order( &mut self, album_artist_sort_order: impl Into<String>, )
Sets the album artist sort order (soaa). This will remove all other album artist sort orders.
Sourcepub fn add_album_artist_sort_orders(
&mut self,
album_artist_sort_orders: impl IntoIterator<Item = String>,
)
pub fn add_album_artist_sort_orders( &mut self, album_artist_sort_orders: impl IntoIterator<Item = String>, )
Adds all album artist sort orders (soaa).
Sourcepub fn add_album_artist_sort_order(
&mut self,
album_artist_sort_order: impl Into<String>,
)
pub fn add_album_artist_sort_order( &mut self, album_artist_sort_order: impl Into<String>, )
Adds an album artist sort order (soaa).
Sourcepub fn remove_album_artist_sort_orders(&mut self)
pub fn remove_album_artist_sort_orders(&mut self)
Removes all album artist sort orders (soaa).
Sourcepub fn artist_sort_orders(&self) -> impl Iterator<Item = &str>
pub fn artist_sort_orders(&self) -> impl Iterator<Item = &str>
Returns all artist sort orders (soar).
Sourcepub fn artist_sort_order(&self) -> Option<&str>
pub fn artist_sort_order(&self) -> Option<&str>
Returns the first artist sort order (soar).
Sourcepub fn take_artist_sort_orders(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_artist_sort_orders(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all artist sort orders (soar).
Sourcepub fn take_artist_sort_order(&mut self) -> Option<String>
pub fn take_artist_sort_order(&mut self) -> Option<String>
Removes all and returns the first artist sort order (soar).
Sourcepub fn set_artist_sort_orders(
&mut self,
artist_sort_orders: impl IntoIterator<Item = String>,
)
pub fn set_artist_sort_orders( &mut self, artist_sort_orders: impl IntoIterator<Item = String>, )
Sets all artist sort orders (soar). This will remove all other artist sort orders.
Sourcepub fn set_artist_sort_order(&mut self, artist_sort_order: impl Into<String>)
pub fn set_artist_sort_order(&mut self, artist_sort_order: impl Into<String>)
Sets the artist sort order (soar). This will remove all other artist sort orders.
Sourcepub fn add_artist_sort_orders(
&mut self,
artist_sort_orders: impl IntoIterator<Item = String>,
)
pub fn add_artist_sort_orders( &mut self, artist_sort_orders: impl IntoIterator<Item = String>, )
Adds all artist sort orders (soar).
Sourcepub fn add_artist_sort_order(&mut self, artist_sort_order: impl Into<String>)
pub fn add_artist_sort_order(&mut self, artist_sort_order: impl Into<String>)
Adds an artist sort order (soar).
Sourcepub fn remove_artist_sort_orders(&mut self)
pub fn remove_artist_sort_orders(&mut self)
Removes all artist sort orders (soar).
Sourcepub fn composer_sort_orders(&self) -> impl Iterator<Item = &str>
pub fn composer_sort_orders(&self) -> impl Iterator<Item = &str>
Returns all composer sort orders (soco).
Sourcepub fn composer_sort_order(&self) -> Option<&str>
pub fn composer_sort_order(&self) -> Option<&str>
Returns the first composer sort order (soco).
Sourcepub fn take_composer_sort_orders(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_composer_sort_orders(&mut self) -> impl Iterator<Item = String> + '_
Removes and returns all composer sort orders (soco).
Sourcepub fn take_composer_sort_order(&mut self) -> Option<String>
pub fn take_composer_sort_order(&mut self) -> Option<String>
Removes all and returns the first composer sort order (soco).
Sourcepub fn set_composer_sort_orders(
&mut self,
composer_sort_orders: impl IntoIterator<Item = String>,
)
pub fn set_composer_sort_orders( &mut self, composer_sort_orders: impl IntoIterator<Item = String>, )
Sets all composer sort orders (soco). This will remove all other composer sort orders.
Sourcepub fn set_composer_sort_order(
&mut self,
composer_sort_order: impl Into<String>,
)
pub fn set_composer_sort_order( &mut self, composer_sort_order: impl Into<String>, )
Sets the composer sort order (soco). This will remove all other composer sort orders.
Sourcepub fn add_composer_sort_orders(
&mut self,
composer_sort_orders: impl IntoIterator<Item = String>,
)
pub fn add_composer_sort_orders( &mut self, composer_sort_orders: impl IntoIterator<Item = String>, )
Adds all composer sort orders (soco).
Sourcepub fn add_composer_sort_order(
&mut self,
composer_sort_order: impl Into<String>,
)
pub fn add_composer_sort_order( &mut self, composer_sort_order: impl Into<String>, )
Adds an composer sort order (soco).
Sourcepub fn remove_composer_sort_orders(&mut self)
pub fn remove_composer_sort_orders(&mut self)
Removes all composer sort orders (soco).
Sourcepub fn compilation(&self) -> bool
pub fn compilation(&self) -> bool
Returns the compilation flag (cpil).
Sourcepub fn set_compilation(&mut self)
pub fn set_compilation(&mut self)
Sets the compilation flag to true (cpil).
Sourcepub fn remove_compilation(&mut self)
pub fn remove_compilation(&mut self)
Removes the compilation flag (cpil).
Sourcepub fn gapless_playback(&self) -> bool
pub fn gapless_playback(&self) -> bool
Returns the gapless playback flag (pgap).
Sourcepub fn set_gapless_playback(&mut self)
pub fn set_gapless_playback(&mut self)
Sets the gapless playback flag to true (pgap).
Sourcepub fn remove_gapless_playback(&mut self)
pub fn remove_gapless_playback(&mut self)
Removes the gapless playback flag (pgap).
Sourcepub fn show_movement(&self) -> bool
pub fn show_movement(&self) -> bool
Returns the show movement flag (shwm).
Sourcepub fn set_show_movement(&mut self)
pub fn set_show_movement(&mut self)
Sets the show movement flag to true (shwm).
Sourcepub fn remove_show_movement(&mut self)
pub fn remove_show_movement(&mut self)
Removes the show movement flag (shwm).
Sourcepub fn remove_bpm(&mut self)
pub fn remove_bpm(&mut self)
Removes the bpm (tmpo).
Sourcepub fn movement_count(&self) -> Option<u16>
pub fn movement_count(&self) -> Option<u16>
Returns the movement count (©mvc)
Sourcepub fn set_movement_count(&mut self, movement_count: u16)
pub fn set_movement_count(&mut self, movement_count: u16)
Sets the movement count (©mvc)
Sourcepub fn remove_movement_count(&mut self)
pub fn remove_movement_count(&mut self)
Removes the movement count (©mvc).
Sourcepub fn movement_index(&self) -> Option<u16>
pub fn movement_index(&self) -> Option<u16>
Returns the movement index (©mvi)
Sourcepub fn set_movement_index(&mut self, movement_index: u16)
pub fn set_movement_index(&mut self, movement_index: u16)
Sets the movement index (©mvi)
Sourcepub fn remove_movement_index(&mut self)
pub fn remove_movement_index(&mut self)
Removes the movement index (©mvi).
Sourcepub fn tv_episode(&self) -> Option<u32>
pub fn tv_episode(&self) -> Option<u32>
Returns the tv episode (tves)
Sourcepub fn set_tv_episode(&mut self, tv_episode: u32)
pub fn set_tv_episode(&mut self, tv_episode: u32)
Sets the tv episode (tves)
Sourcepub fn remove_tv_episode(&mut self)
pub fn remove_tv_episode(&mut self)
Removes the tv episode (tves).
Sourcepub fn set_tv_season(&mut self, tv_season: u32)
pub fn set_tv_season(&mut self, tv_season: u32)
Sets the tv season (tvsn)
Sourcepub fn remove_tv_season(&mut self)
pub fn remove_tv_season(&mut self)
Removes the tv season (tvsn).
Sourcepub fn standard_genres(&self) -> impl Iterator<Item = u16> + '_
pub fn standard_genres(&self) -> impl Iterator<Item = u16> + '_
Returns all standard genres (gnre).
Sourcepub fn standard_genre(&self) -> Option<u16>
pub fn standard_genre(&self) -> Option<u16>
Returns the first standard genre (gnre).
Sourcepub fn set_standard_genre(&mut self, genre_code: u16)
pub fn set_standard_genre(&mut self, genre_code: u16)
Sets the standard genre (gnre). This will remove all other standard genres.
Sourcepub fn set_standard_genres(
&mut self,
genre_codes: impl IntoIterator<Item = u16>,
)
pub fn set_standard_genres( &mut self, genre_codes: impl IntoIterator<Item = u16>, )
Sets all standard genres (gnre). This will remove all other standard genres.
Sourcepub fn add_standard_genre(&mut self, genre_code: u16)
pub fn add_standard_genre(&mut self, genre_code: u16)
Adds a standard genre (gnre).
Sourcepub fn add_standard_genres(
&mut self,
genre_codes: impl IntoIterator<Item = u16>,
)
pub fn add_standard_genres( &mut self, genre_codes: impl IntoIterator<Item = u16>, )
Adds all standard genres (gnre).
Sourcepub fn remove_standard_genres(&mut self)
pub fn remove_standard_genres(&mut self)
Removes all standard genres (gnre).
Sourcepub fn genres(&self) -> impl Iterator<Item = &str> + '_
pub fn genres(&self) -> impl Iterator<Item = &str> + '_
Returns all genres, first the standard genres (gnre) then custom ones (©gen).
Sourcepub fn take_genres(&mut self) -> impl Iterator<Item = String> + '_
pub fn take_genres(&mut self) -> impl Iterator<Item = String> + '_
Removes all custom genres (©gen) and returns all genres, first standard genres (gnre)
then custom ones (©gen).
Sourcepub fn take_genre(&mut self) -> Option<String>
pub fn take_genre(&mut self) -> Option<String>
Removes all custom genres (©gen) and returns the first genre (gnre or ©gen).
Sourcepub fn set_genre(&mut self, genre: impl Into<String>)
pub fn set_genre(&mut self, genre: impl Into<String>)
Sets the custom genre (©gen). This will remove all other standard or custom genres.
Sourcepub fn set_genres(&mut self, genres: impl IntoIterator<Item = String>)
pub fn set_genres(&mut self, genres: impl IntoIterator<Item = String>)
Sets the custom genre (©gen). This will remove all other standard or custom genres.
Sourcepub fn remove_genres(&mut self)
pub fn remove_genres(&mut self)
Removes the genre (gnre or ©gen).
Sourcepub fn track(&self) -> (Option<u16>, Option<u16>)
pub fn track(&self) -> (Option<u16>, Option<u16>)
Returns the track number and the total number of tracks (trkn).
Sourcepub fn track_number(&self) -> Option<u16>
pub fn track_number(&self) -> Option<u16>
Returns the track number (trkn).
Sourcepub fn total_tracks(&self) -> Option<u16>
pub fn total_tracks(&self) -> Option<u16>
Returns the total number of tracks (trkn).
Sourcepub fn set_track(&mut self, track_number: u16, total_tracks: u16)
pub fn set_track(&mut self, track_number: u16, total_tracks: u16)
Sets the track number and the total number of tracks (trkn).
Sourcepub fn set_track_number(&mut self, track_number: u16)
pub fn set_track_number(&mut self, track_number: u16)
Sets the track number (trkn).
Sourcepub fn set_total_tracks(&mut self, total_tracks: u16)
pub fn set_total_tracks(&mut self, total_tracks: u16)
Sets the total number of tracks (trkn).
Sourcepub fn remove_track(&mut self)
pub fn remove_track(&mut self)
Removes the track number and the total number of tracks (trkn).
Sourcepub fn remove_track_number(&mut self)
pub fn remove_track_number(&mut self)
Removes the track number, preserving the total number of tracks if present (trkn).
Sourcepub fn remove_total_tracks(&mut self)
pub fn remove_total_tracks(&mut self)
Removes the total number of tracks, preserving the track number if present (trkn).
Sourcepub fn disc(&self) -> (Option<u16>, Option<u16>)
pub fn disc(&self) -> (Option<u16>, Option<u16>)
Returns the disc number and total number of discs (disk).
Sourcepub fn disc_number(&self) -> Option<u16>
pub fn disc_number(&self) -> Option<u16>
Returns the disc number (disk).
Sourcepub fn total_discs(&self) -> Option<u16>
pub fn total_discs(&self) -> Option<u16>
Returns the total number of discs (disk).
Sourcepub fn set_disc(&mut self, disc_number: u16, total_discs: u16)
pub fn set_disc(&mut self, disc_number: u16, total_discs: u16)
Sets the disc number and the total number of discs (disk).
Sourcepub fn set_disc_number(&mut self, disc_number: u16)
pub fn set_disc_number(&mut self, disc_number: u16)
Sets the disc number (disk).
Sourcepub fn set_total_discs(&mut self, total_discs: u16)
pub fn set_total_discs(&mut self, total_discs: u16)
Sets the total number of discs (disk).
Sourcepub fn remove_disc(&mut self)
pub fn remove_disc(&mut self)
Removes the disc number and the total number of discs (disk).
Sourcepub fn remove_disc_number(&mut self)
pub fn remove_disc_number(&mut self)
Removes the disc number, preserving the total number of discs if present (disk).
Sourcepub fn remove_total_discs(&mut self)
pub fn remove_total_discs(&mut self)
Removes the total number of discs, preserving the disc number if present (disk).
Sourcepub fn write_with(&self, file: &File, cfg: &WriteConfig) -> Result<()>
pub fn write_with(&self, file: &File, cfg: &WriteConfig) -> Result<()>
Attempts to write the MPEG-4 audio tag to the writer.
Sourcepub fn write_to(&self, file: &File) -> Result<()>
pub fn write_to(&self, file: &File) -> Result<()>
Attempts to write the MPEG-4 audio tag to the writer. This will overwrite any metadata previously present on the file.
Sourcepub fn write_with_path(
&self,
path: impl AsRef<Path>,
cfg: &WriteConfig,
) -> Result<()>
pub fn write_with_path( &self, path: impl AsRef<Path>, cfg: &WriteConfig, ) -> Result<()>
Attempts to write the MPEG-4 audio tag to the path.
Sourcepub fn write_to_path(&self, path: impl AsRef<Path>) -> Result<()>
pub fn write_to_path(&self, path: impl AsRef<Path>) -> Result<()>
Attempts to write the MPEG-4 audio tag to the path. This will overwrite any metadata previously present on the file.
Sourcepub fn take_artworks(&mut self) -> impl Iterator<Item = ImgBuf> + '_
pub fn take_artworks(&mut self) -> impl Iterator<Item = ImgBuf> + '_
Removes and returns all artwork images (covr).
Sourcepub fn take_artwork(&mut self) -> Option<ImgBuf>
pub fn take_artwork(&mut self) -> Option<ImgBuf>
Removes all and returns the first artwork image (covr).
Sourcepub fn set_artwork(&mut self, image: Img<impl Into<Vec<u8>>>)
pub fn set_artwork(&mut self, image: Img<impl Into<Vec<u8>>>)
Sets the artwork image data (covr). This will remove all other artworks.
Sourcepub fn set_artworks(&mut self, images: impl IntoIterator<Item = ImgBuf>)
pub fn set_artworks(&mut self, images: impl IntoIterator<Item = ImgBuf>)
Sets all artwork image data (covr). This will remove all other artworks.
Sourcepub fn add_artworks(&mut self, images: impl IntoIterator<Item = ImgBuf>)
pub fn add_artworks(&mut self, images: impl IntoIterator<Item = ImgBuf>)
Adds artwork image data (covr).
Sourcepub fn remove_artworks(&mut self)
pub fn remove_artworks(&mut self)
Removes all artworks (covr).
Sourcepub fn media_type(&self) -> Option<MediaType>
pub fn media_type(&self) -> Option<MediaType>
Returns the media type (stik).
Sourcepub fn set_media_type(&mut self, media_type: MediaType)
pub fn set_media_type(&mut self, media_type: MediaType)
Sets the media type (stik).
Sourcepub fn remove_media_type(&mut self)
pub fn remove_media_type(&mut self)
Removes the media type (stik).
Sourcepub fn advisory_rating(&self) -> Option<AdvisoryRating>
pub fn advisory_rating(&self) -> Option<AdvisoryRating>
Returns the advisory rating (rtng).
Sourcepub fn set_advisory_rating(&mut self, rating: AdvisoryRating)
pub fn set_advisory_rating(&mut self, rating: AdvisoryRating)
Sets the advisory rating (rtng).
Sourcepub fn remove_advisory_rating(&mut self)
pub fn remove_advisory_rating(&mut self)
Removes the advisory rating (rtng).
Sourcepub fn chapters(&self) -> &[Chapter]
pub fn chapters(&self) -> &[Chapter]
Returns either the chapter list or the chapter track. The chapter list is preferred.
Sourcepub fn chapters_mut(&mut self) -> &mut Vec<Chapter>
pub fn chapters_mut(&mut self) -> &mut Vec<Chapter>
Returns either the chapter list or the chapter track. The chapter list is preferred.
Sourcepub fn take_chapters(&mut self) -> Vec<Chapter>
pub fn take_chapters(&mut self) -> Vec<Chapter>
Removes and returns either the chapter list or the chapter track. The chapter list is preferred.
Sourcepub fn chapter_list(&self) -> &[Chapter]
pub fn chapter_list(&self) -> &[Chapter]
Returns the chapter list.
Sourcepub fn chapter_list_mut(&mut self) -> &mut Vec<Chapter>
pub fn chapter_list_mut(&mut self) -> &mut Vec<Chapter>
Returns the chapter list.
Sourcepub fn take_chapter_list(&mut self) -> Vec<Chapter>
pub fn take_chapter_list(&mut self) -> Vec<Chapter>
Removes and returns the chapter list.
Sourcepub fn chapter_track(&self) -> &[Chapter]
pub fn chapter_track(&self) -> &[Chapter]
Returns the chapter track.
Sourcepub fn chapter_track_mut(&mut self) -> &mut Vec<Chapter>
pub fn chapter_track_mut(&mut self) -> &mut Vec<Chapter>
Returns the chapter track.
Sourcepub fn take_chapter_track(&mut self) -> Vec<Chapter>
pub fn take_chapter_track(&mut self) -> Vec<Chapter>
Removes and returns the chapter track.
Sourcepub fn bytes_of<'a>(
&'a self,
ident: &impl Ident,
) -> impl Iterator<Item = &'a [u8]>
pub fn bytes_of<'a>( &'a self, ident: &impl Ident, ) -> impl Iterator<Item = &'a [u8]>
Returns references to all byte data corresponding to the identifier.
See Data::bytes.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::BeSigned(b"data".to_vec()));
assert_eq!(tag.bytes_of(&test).next().unwrap(), b"data");Sourcepub fn bytes_mut_of(
&mut self,
ident: &impl Ident,
) -> impl Iterator<Item = &mut Vec<u8>>
pub fn bytes_mut_of( &mut self, ident: &impl Ident, ) -> impl Iterator<Item = &mut Vec<u8>>
Returns mutable references to all byte data corresponding to the identifier.
See Data::bytes_mut.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Reserved(b"data".to_vec()));
tag.bytes_mut_of(&test).next().unwrap().push('1' as u8);
assert_eq!(tag.bytes_of(&test).next().unwrap(), b"data1");Sourcepub fn take_bytes_of(
&mut self,
ident: &impl Ident,
) -> impl Iterator<Item = Vec<u8>>
pub fn take_bytes_of( &mut self, ident: &impl Ident, ) -> impl Iterator<Item = Vec<u8>>
Removes the atom corresponding to the identifier and returns all of it’s byte data.
See Data::into_bytes.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Reserved(b"data".to_vec()));
assert_eq!(tag.take_bytes_of(&test).next().unwrap(), b"data");
assert_eq!(tag.bytes_of(&test).next(), None);Sourcepub fn strings_of<'a>(
&'a self,
ident: &impl Ident,
) -> impl Iterator<Item = &'a str>
pub fn strings_of<'a>( &'a self, ident: &impl Ident, ) -> impl Iterator<Item = &'a str>
Returns references to all strings corresponding to the identifier.
See Data::string.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("data".into()));
assert_eq!(tag.strings_of(&test).next().unwrap(), "data");Sourcepub fn strings_mut_of(
&mut self,
ident: &impl Ident,
) -> impl Iterator<Item = &mut String>
pub fn strings_mut_of( &mut self, ident: &impl Ident, ) -> impl Iterator<Item = &mut String>
Returns all mutable string references corresponding to the identifier.
See Data::string_mut.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("string".into()));
tag.strings_mut_of(&test).next().unwrap().push('1');
assert_eq!(tag.strings_of(&test).next().unwrap(), "string1");Sourcepub fn take_strings_of(
&mut self,
ident: &impl Ident,
) -> impl Iterator<Item = String>
pub fn take_strings_of( &mut self, ident: &impl Ident, ) -> impl Iterator<Item = String>
Removes the atom corresponding to the identifier and returns all of it’s strings.
See Data::into_string.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("string".into()));
assert_eq!(tag.take_strings_of(&test).next().unwrap(), "string");
assert_eq!(tag.strings_of(&test).next(), None);Sourcepub fn images_of<'a>(
&'a self,
ident: &impl Ident,
) -> impl Iterator<Item = ImgRef<'a>>
pub fn images_of<'a>( &'a self, ident: &impl Ident, ) -> impl Iterator<Item = ImgRef<'a>>
Returns references to all images corresponding to the identifier.
See Data::image.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Jpeg(b"image".to_vec()));
let img = tag.images_of(&test).next().unwrap();
assert_eq!(img.data, b"image");Sourcepub fn images_mut_of<'a>(
&'a mut self,
ident: &impl Ident,
) -> impl Iterator<Item = ImgMut<'a>>
pub fn images_mut_of<'a>( &'a mut self, ident: &impl Ident, ) -> impl Iterator<Item = ImgMut<'a>>
Returns mutable references to all images corresponding to the identifier.
See Data::image_mut.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Jpeg(b"image".to_vec()));
let img = tag.images_mut_of(&test).next().unwrap();
img.data.push('1' as u8);
let img = tag.images_of(&test).next().unwrap();
assert_eq!(img.data, b"image1");Sourcepub fn take_images_of(
&mut self,
ident: &impl Ident,
) -> impl Iterator<Item = ImgBuf>
pub fn take_images_of( &mut self, ident: &impl Ident, ) -> impl Iterator<Item = ImgBuf>
Removes the atom corresponding to the identifier and returns all of it’s images.
See Data::into_image.
§Example
use mp4ameta::{Userdata, Data, Fourcc, Img};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Png(b"image".to_vec()));
assert_eq!(tag.take_images_of(&test).next().unwrap(), Img::png(b"image".to_vec()));
assert_eq!(tag.images_of(&test).next(), None);Sourcepub fn data_of<'a>(
&'a self,
ident: &impl Ident,
) -> impl Iterator<Item = &'a Data>
pub fn data_of<'a>( &'a self, ident: &impl Ident, ) -> impl Iterator<Item = &'a Data>
Returns references to all data corresponding to the identifier.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("data".into()));
assert_eq!(tag.data_of(&test).next().unwrap().string(), Some("data"));Sourcepub fn data_mut_of(
&mut self,
ident: &impl Ident,
) -> impl Iterator<Item = &mut Data>
pub fn data_mut_of( &mut self, ident: &impl Ident, ) -> impl Iterator<Item = &mut Data>
Returns mutable references to all data corresponding to the identifier.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("data".into()));
let data = tag.data_mut_of(&test).next().unwrap();
data.string_mut().unwrap().push('1');
assert_eq!(tag.strings_of(&test).next().unwrap(), "data1");Sourcepub fn take_data_of(&mut self, ident: &impl Ident) -> impl Iterator<Item = Data>
pub fn take_data_of(&mut self, ident: &impl Ident) -> impl Iterator<Item = Data>
Removes the atom corresponding to the identifier and returns all of it’s data.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("data".into()));
assert_eq!(tag.take_data_of(&test).next().unwrap(), Data::Utf8("data".into()));
assert_eq!(tag.data_of(&test).next(), None);Sourcepub fn bytes(&self) -> impl Iterator<Item = (&DataIdent, &[u8])>
pub fn bytes(&self) -> impl Iterator<Item = (&DataIdent, &[u8])>
Returns an iterator over references to all byte data.
§Example
use mp4ameta::{Userdata, Data, DataIdent, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Reserved(b"data1".to_vec()));
tag.add_data(test, Data::Utf8("string".into()));
tag.add_data(test, Data::BeSigned(b"data2".to_vec()));
let test = DataIdent::Fourcc(test);
let mut bytes = tag.bytes();
assert_eq!(bytes.next().unwrap(), (&test, &b"data1"[..]));
assert_eq!(bytes.next().unwrap(), (&test, &b"data2"[..]));
assert_eq!(bytes.next(), None);Sourcepub fn bytes_mut(&mut self) -> impl Iterator<Item = (&DataIdent, &mut Vec<u8>)>
pub fn bytes_mut(&mut self) -> impl Iterator<Item = (&DataIdent, &mut Vec<u8>)>
Returns an iterator over mutable references to all byte data.
§Example
use mp4ameta::{Userdata, Data, DataIdent, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Reserved(b"data".to_vec()));
tag.add_data(test, Data::Utf8("string".into()));
let (ident, data) = tag.bytes_mut().next().unwrap();
data.push('1' as u8);
let test = DataIdent::Fourcc(test);
let mut bytes = tag.bytes();
assert_eq!(bytes.next().unwrap(), (&test, &b"data1"[..]));
assert_eq!(bytes.next(), None);Sourcepub fn strings(&self) -> impl Iterator<Item = (&DataIdent, &str)>
pub fn strings(&self) -> impl Iterator<Item = (&DataIdent, &str)>
Returns an iterator over references to all strings.
§Example
use mp4ameta::{Userdata, Data, DataIdent, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Utf8("string1".into()));
tag.add_data(test, Data::Reserved(b"data".to_vec()));
tag.add_data(test, Data::Utf16("string2".into()));
let test = DataIdent::Fourcc(test);
let mut strings = tag.strings();
assert_eq!(strings.next().unwrap(), (&test, "string1"));
assert_eq!(strings.next().unwrap(), (&test, "string2"));
assert_eq!(strings.next(), None);Sourcepub fn strings_mut(&mut self) -> impl Iterator<Item = (&DataIdent, &mut String)>
pub fn strings_mut(&mut self) -> impl Iterator<Item = (&DataIdent, &mut String)>
Returns an iterator over mutable references to all strings.
§Example
use mp4ameta::{Userdata, Data, DataIdent, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Reserved(b"data".to_vec()));
tag.add_data(test, Data::Utf8("string".into()));
let (ident, data) = tag.strings_mut().next().unwrap();
data.push('1');
let test = DataIdent::Fourcc(test);
let mut strings = tag.strings();
assert_eq!(strings.next().unwrap(), (&test, "string1"));
assert_eq!(strings.next(), None);Sourcepub fn images(&self) -> impl Iterator<Item = (&DataIdent, ImgRef<'_>)>
pub fn images(&self) -> impl Iterator<Item = (&DataIdent, ImgRef<'_>)>
Returns an iterator over references to all images.
§Example
use mp4ameta::{Userdata, Data, DataIdent, Fourcc, Img};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Png(b"image1".to_vec()));
tag.add_data(test, Data::Utf8("string".into()));
tag.add_data(test, Data::Jpeg(b"image2".to_vec()));
let test = DataIdent::Fourcc(test);
let mut images = tag.images();
assert_eq!(images.next().unwrap(), (&test, Img::png(&b"image1"[..])));
assert_eq!(images.next().unwrap(), (&test, Img::jpeg(&b"image2"[..])));
assert_eq!(images.next(), None);Sourcepub fn images_mut(&mut self) -> impl Iterator<Item = (&DataIdent, ImgMut<'_>)>
pub fn images_mut(&mut self) -> impl Iterator<Item = (&DataIdent, ImgMut<'_>)>
Returns an iterator over mutable references to all images.
§Example
use mp4ameta::{Userdata, Data, DataIdent, Fourcc, Img};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Bmp(b"data".to_vec()));
tag.add_data(test, Data::Utf8("string".into()));
let (ident, image) = tag.images_mut().next().unwrap();
image.data.push('1' as u8);
let test = DataIdent::Fourcc(test);
let mut images = tag.images();
assert_eq!(images.next().unwrap(), (&test, Img::bmp(&b"data1"[..])));
assert_eq!(images.next(), None);Sourcepub fn data(&self) -> impl Iterator<Item = (&DataIdent, &Data)>
pub fn data(&self) -> impl Iterator<Item = (&DataIdent, &Data)>
Returns an iterator over references to all data.
§Example
use mp4ameta::{Userdata, Data, DataIdent, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Reserved(b"data".to_vec()));
tag.add_data(test, Data::Utf8("string".into()));
tag.add_data(test, Data::Png(b"image".to_vec()));
let test = DataIdent::Fourcc(test);
let mut data = tag.data();
assert_eq!(data.next().unwrap(), (&test, &Data::Reserved(b"data".to_vec())));
assert_eq!(data.next().unwrap(), (&test, &Data::Utf8("string".into())));
assert_eq!(data.next().unwrap(), (&test, &Data::Png(b"image".to_vec())));
assert_eq!(data.next(), None);Sourcepub fn data_mut(&mut self) -> impl Iterator<Item = (&DataIdent, &mut Data)>
pub fn data_mut(&mut self) -> impl Iterator<Item = (&DataIdent, &mut Data)>
Returns an iterator over mutable references to all data.
§Example
use mp4ameta::{Userdata, Data, DataIdent, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Utf8("string".into()));
let (ident, data) = tag.data_mut().next().unwrap();
data.string_mut().unwrap().push('1');
let test = DataIdent::Fourcc(test);
let mut strings = tag.strings();
assert_eq!(strings.next().unwrap(), (&test, "string1"));
assert_eq!(strings.next(), None);Sourcepub fn remove_bytes_of(&mut self, ident: &impl Ident)
pub fn remove_bytes_of(&mut self, ident: &impl Ident)
Removes all byte data corresponding to the identifier. Other data will remain unaffected.
See Data::is_bytes
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Utf8("string".into()));
tag.add_data(test, Data::BeSigned("data".into()));
let mut data = tag.data_of(&test);
assert_eq!(data.next(), Some(&Data::Utf8("string".into())));
assert_eq!(data.next(), Some(&Data::BeSigned(b"data".to_vec())));
assert_eq!(data.next(), None);
drop(data);
tag.remove_bytes_of(&test);
let mut data = tag.data_of(&test);
assert_eq!(data.next(), Some(&Data::Utf8("string".into())));
assert_eq!(data.next(), None);Sourcepub fn remove_strings_of(&mut self, ident: &impl Ident)
pub fn remove_strings_of(&mut self, ident: &impl Ident)
Removes all strings corresponding to the identifier. Other data will remain unaffected.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Utf8("string".into()));
tag.add_data(test, Data::Bmp("image".into()));
let mut data = tag.data_of(&test);
assert_eq!(data.next(), Some(&Data::Utf8("string".into())));
assert_eq!(data.next(), Some(&Data::Bmp(b"image".to_vec())));
assert_eq!(data.next(), None);
drop(data);
tag.remove_strings_of(&test);
let mut data = tag.data_of(&test);
assert_eq!(data.next(), Some(&Data::Bmp(b"image".to_vec())));
assert_eq!(data.next(), None);Sourcepub fn remove_images_of(&mut self, ident: &impl Ident)
pub fn remove_images_of(&mut self, ident: &impl Ident)
Removes all images corresponding to the identifier. Other data will remain unaffected.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Utf8("string".into()));
tag.add_data(test, Data::Bmp("image".into()));
let mut data = tag.data_of(&test);
assert_eq!(data.next(), Some(&Data::Utf8("string".into())));
assert_eq!(data.next(), Some(&Data::Bmp(b"image".to_vec())));
assert_eq!(data.next(), None);
drop(data);
tag.remove_images_of(&test);
let mut data = tag.data_of(&test);
assert_eq!(data.next(), Some(&Data::Utf8("string".into())));
assert_eq!(data.next(), None);Sourcepub fn remove_data_of(&mut self, ident: &impl Ident)
pub fn remove_data_of(&mut self, ident: &impl Ident)
Removes all data corresponding to the identifier.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("data".into()));
assert!(tag.data_of(&test).next().is_some());
tag.remove_data_of(&test);
assert!(tag.data_of(&test).next().is_none());Sourcepub fn retain_bytes_of(
&mut self,
ident: &impl Ident,
predicate: impl Fn(&[u8]) -> bool,
)
pub fn retain_bytes_of( &mut self, ident: &impl Ident, predicate: impl Fn(&[u8]) -> bool, )
Retains only the bytes, of the atom corresponding to the identifier, that match the predicate.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::BeSigned(vec![4; 12]));
tag.add_data(test, Data::Reserved(vec![6; 16]));
let mut bytes = tag.bytes_of(&test);
assert_eq!(bytes.next(), Some(&[4; 12][..]));
assert_eq!(bytes.next(), Some(&[6; 16][..]));
assert_eq!(bytes.next(), None);
drop(bytes);
tag.retain_bytes_of(&test, |b| b[2..4] == [4, 4]);
let mut bytes = tag.bytes_of(&test);
assert_eq!(bytes.next(), Some(&[4; 12][..]));
assert_eq!(bytes.next(), None);Sourcepub fn retain_strings_of(
&mut self,
ident: &impl Ident,
predicate: impl Fn(&str) -> bool,
)
pub fn retain_strings_of( &mut self, ident: &impl Ident, predicate: impl Fn(&str) -> bool, )
Retains only the strings, of the atom corresponding to the identifier, that match the predicate.
§Example
use mp4ameta::{Userdata, Data, Fourcc, Img, ImgFmt};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Utf8("string1".into()));
tag.add_data(test, Data::Utf8("string2".into()));
let mut strings = tag.strings_of(&test);
assert_eq!(strings.next(), Some("string1"));
assert_eq!(strings.next(), Some("string2"));
assert_eq!(strings.next(), None);
drop(strings);
tag.retain_strings_of(&test, |s| s.ends_with("1"));
let mut strings = tag.strings_of(&test);
assert_eq!(strings.next(), Some("string1"));
assert_eq!(strings.next(), None);Sourcepub fn retain_images_of(
&mut self,
ident: &impl Ident,
predicate: impl Fn(ImgRef<'_>) -> bool,
)
pub fn retain_images_of( &mut self, ident: &impl Ident, predicate: impl Fn(ImgRef<'_>) -> bool, )
Retains only the images, of the atom corresponding to the identifier, that match the predicate.
§Example
use mp4ameta::{Userdata, Data, Fourcc, Img, ImgFmt};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Png(vec![5; 4]));
tag.add_data(test, Data::Jpeg(vec![6; 16]));
let mut images = tag.images_of(&test);
assert_eq!(images.next(), Some(Img::new(ImgFmt::Png, &[5; 4][..])));
assert_eq!(images.next(), Some(Img::new(ImgFmt::Jpeg, &[6; 16][..])));
assert_eq!(images.next(), None);
drop(images);
tag.retain_images_of(&test, |d| d.fmt == ImgFmt::Jpeg);
let mut images = tag.images_of(&test);
assert_eq!(images.next(), Some(Img::new(ImgFmt::Jpeg, &[6; 16][..])));
assert_eq!(images.next(), None);Sourcepub fn retain_data_of(
&mut self,
ident: &impl Ident,
predicate: impl Fn(&Data) -> bool,
)
pub fn retain_data_of( &mut self, ident: &impl Ident, predicate: impl Fn(&Data) -> bool, )
Retains only the data, of the atom corresponding to the identifier, that matches the predicate.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Utf8("short".into()));
tag.add_data(test, Data::Reserved(vec![6; 16]));
let mut data = tag.data_of(&test);
assert_eq!(data.next(), Some(&Data::Utf8("short".into())));
assert_eq!(data.next(), Some(&Data::Reserved(vec![6; 16])));
assert_eq!(data.next(), None);
drop(data);
tag.retain_data_of(&test, |d| d.data_len() < 10);
let mut data = tag.data_of(&test);
assert_eq!(data.next(), Some(&Data::Utf8("short".into())));
assert_eq!(data.next(), None);Sourcepub fn retain_bytes(&mut self, predicate: impl Fn(&DataIdent, &[u8]) -> bool)
pub fn retain_bytes(&mut self, predicate: impl Fn(&DataIdent, &[u8]) -> bool)
Retains only the byte data matching the predicate. Other data will remain unaffected.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let tst1 = Fourcc(*b"tst1");
let tst2 = Fourcc(*b"tst2");
tag.add_data(tst1, Data::Reserved(b"data1".to_vec()));
tag.add_data(tst2, Data::Png(b"data2".to_vec()));
tag.add_data(tst2, Data::BeSigned(b"data3".to_vec()));
let mut data = tag.data().map(|(i, d)| d);
assert_eq!(data.next(), Some(&Data::Reserved(b"data1".to_vec())));
assert_eq!(data.next(), Some(&Data::Png(b"data2".to_vec())));
assert_eq!(data.next(), Some(&Data::BeSigned(b"data3".to_vec())));
assert_eq!(data.next(), None);
drop(data);
tag.retain_bytes(|i, d| &tst1 == i);
let mut data = tag.data().map(|(i, d)| d);
assert_eq!(data.next(), Some(&Data::Reserved(b"data1".to_vec())));
assert_eq!(data.next(), Some(&Data::Png(b"data2".to_vec())));
assert_eq!(data.next(), None);Sourcepub fn retain_strings(&mut self, predicate: impl Fn(&DataIdent, &str) -> bool)
pub fn retain_strings(&mut self, predicate: impl Fn(&DataIdent, &str) -> bool)
Retains only the strings matching the predicate. Other data will remain unaffected.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let tst1 = Fourcc(*b"tst1");
let tst2 = Fourcc(*b"tst2");
tag.add_data(tst1, Data::Utf8("data1".into()));
tag.add_data(tst2, Data::Png(b"data2".to_vec()));
tag.add_data(tst2, Data::Utf8("data3".into()));
let mut data = tag.data().map(|(i, d)| d);
assert_eq!(data.next(), Some(&Data::Utf8("data1".into())));
assert_eq!(data.next(), Some(&Data::Png(b"data2".to_vec())));
assert_eq!(data.next(), Some(&Data::Utf8("data3".into())));
assert_eq!(data.next(), None);
drop(data);
tag.retain_strings(|i, d| &tst1 == i);
let mut data = tag.data().map(|(i, d)| d);
assert_eq!(data.next(), Some(&Data::Utf8("data1".into())));
assert_eq!(data.next(), Some(&Data::Png(b"data2".to_vec())));
assert_eq!(data.next(), None);Sourcepub fn retain_images(
&mut self,
predicate: impl Fn(&DataIdent, ImgRef<'_>) -> bool,
)
pub fn retain_images( &mut self, predicate: impl Fn(&DataIdent, ImgRef<'_>) -> bool, )
Retains only the images matching the predicate. Other data will remain unaffected.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let tst1 = Fourcc(*b"tst1");
let tst2 = Fourcc(*b"tst2");
tag.add_data(tst1, Data::Jpeg(b"data1".to_vec()));
tag.add_data(tst2, Data::Png(b"data2".to_vec()));
tag.add_data(tst2, Data::Utf8("data3".into()));
let mut data = tag.data().map(|(i, d)| d);
assert_eq!(data.next(), Some(&Data::Jpeg(b"data1".to_vec())));
assert_eq!(data.next(), Some(&Data::Png(b"data2".to_vec())));
assert_eq!(data.next(), Some(&Data::Utf8("data3".into())));
assert_eq!(data.next(), None);
drop(data);
tag.retain_images(|i, d| &tst1 == i);
let mut data = tag.data().map(|(i, d)| d);
assert_eq!(data.next(), Some(&Data::Jpeg(b"data1".to_vec())));
assert_eq!(data.next(), Some(&Data::Utf8("data3".into())));
assert_eq!(data.next(), None);Sourcepub fn retain_data(&mut self, predicate: impl Fn(&DataIdent, &Data) -> bool)
pub fn retain_data(&mut self, predicate: impl Fn(&DataIdent, &Data) -> bool)
Retains only the data matching the predicate.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let tst1 = Fourcc(*b"tst1");
let tst2 = Fourcc(*b"tst2");
tag.add_data(tst1, Data::Utf8("data1".into()));
tag.add_data(tst2, Data::Utf8("data2".into()));
let mut data = tag.data().map(|(i, d)| d);
assert_eq!(data.next(), Some(&Data::Utf8("data1".into())));
assert_eq!(data.next(), Some(&Data::Utf8("data2".into())));
assert_eq!(data.next(), None);
drop(data);
tag.retain_data(|i, d| &tst1 != i);
let mut data = tag.data().map(|(i, d)| d);
assert_eq!(data.next(), Some(&Data::Utf8("data2".into())));
assert_eq!(data.next(), None);Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Removes user data. This includes the metadata item list as well as the chapter list and track.
§Example
use std::time::Duration;
use mp4ameta::{Userdata, Chapter, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("data".into()));
tag.chapter_list_mut().push(Chapter::new(Duration::ZERO, "first"));
assert!(!tag.is_empty());
tag.clear();
assert!(tag.is_empty());Sourcepub fn clear_meta_items(&mut self)
pub fn clear_meta_items(&mut self)
Clear the metadata item list.
§Example
use std::time::Duration;
use mp4ameta::{Userdata, Chapter, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("data".into()));
tag.chapter_list_mut().push(Chapter::new(Duration::ZERO, "first"));
assert!(!tag.is_empty());
assert!(!tag.meta_items_is_empty());
tag.clear_meta_items();
assert!(!tag.is_empty());
assert!(tag.meta_items_is_empty());Sourcepub fn set_data(&mut self, ident: impl Ident + Into<DataIdent>, data: Data)
pub fn set_data(&mut self, ident: impl Ident + Into<DataIdent>, data: Data)
If an atom corresponding to the identifier exists, it’s data will be replaced by the new data, otherwise a new metadata item atom containing the data will be created.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("data".into()));
assert_eq!(tag.strings_of(&test).next().unwrap(), "data");Sourcepub fn set_all_data(
&mut self,
ident: impl Ident + Into<DataIdent>,
data: impl IntoIterator<Item = Data>,
)
pub fn set_all_data( &mut self, ident: impl Ident + Into<DataIdent>, data: impl IntoIterator<Item = Data>, )
If an atom corresponding to the identifier exists, it’s data will be replaced by the new data, otherwise a new metadata item atom containing the data will be created.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
let data = vec![
Data::Utf8("data1".into()),
Data::Utf8("data2".into()),
];
tag.set_all_data(test, data);
let mut strings = tag.strings_of(&test);
assert_eq!(strings.next(), Some("data1"));
assert_eq!(strings.next(), Some("data2"));
assert_eq!(strings.next(), None);Sourcepub fn add_data(&mut self, ident: impl Ident + Into<DataIdent>, data: Data)
pub fn add_data(&mut self, ident: impl Ident + Into<DataIdent>, data: Data)
If an atom corresponding to the identifier exists, the new data will be added to it, otherwise a new atom containing the data will be created.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.add_data(test, Data::Utf8("data1".into()));
tag.add_data(test, Data::Utf8("data2".into()));
let mut strings = tag.strings_of(&test);
assert_eq!(strings.next(), Some("data1"));
assert_eq!(strings.next(), Some("data2"));
assert_eq!(strings.next(), None)Sourcepub fn add_all_data(
&mut self,
ident: impl Ident + Into<DataIdent>,
data: impl IntoIterator<Item = Data>,
)
pub fn add_all_data( &mut self, ident: impl Ident + Into<DataIdent>, data: impl IntoIterator<Item = Data>, )
If an atom corresponding to the identifier exists, the new data will be added to it, otherwise a new metadata item atom containing the data will be created.
§Example
use mp4ameta::{Userdata, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
let data = vec![
Data::Utf8("data1".into()),
Data::Utf8("data2".into()),
];
tag.add_all_data(test, data);
let mut strings = tag.strings_of(&test);
assert_eq!(strings.next(), Some("data1"));
assert_eq!(strings.next(), Some("data2"));
assert_eq!(strings.next(), None)Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if there is any user data.
This includes the metadata item list as well as the chapter list and track.
§Example
use std::time::Duration;
use mp4ameta::{Userdata, Chapter, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("data".into()));
tag.chapter_list_mut().push(Chapter::new(Duration::ZERO, "first"));
assert!(!tag.is_empty());
tag.clear();
assert!(tag.is_empty());Sourcepub fn meta_items_is_empty(&self) -> bool
pub fn meta_items_is_empty(&self) -> bool
Returns true if metadata item list contains any data.
§Example
use std::time::Duration;
use mp4ameta::{Userdata, Chapter, Data, Fourcc};
let mut tag = Userdata::default();
let test = Fourcc(*b"test");
tag.set_data(test, Data::Utf8("data".into()));
tag.chapter_list_mut().push(Chapter::new(Duration::ZERO, "first"));
assert!(!tag.is_empty());
assert!(!tag.meta_items_is_empty());
tag.clear_meta_items();
assert!(!tag.is_empty());
assert!(tag.meta_items_is_empty());