Struct atm0s_custom_str0m::rtp::ExtensionMap
source · pub struct ExtensionMap(/* private fields */);
Expand description
Mapping between RTP extension id to what extension that is.
Implementations§
source§impl ExtensionMap
impl ExtensionMap
sourcepub fn standard() -> Self
pub fn standard() -> Self
Creates a map with the “standard” mappings.
The standard are taken from Chrome.
sourcepub fn set(&mut self, id: u8, ext: Extension)
pub fn set(&mut self, id: u8, ext: Extension)
Set a mapping for an extension.
The id must be in 1..=MAX_ID (1-indexed).
sourcepub fn lookup(&self, id: u8) -> Option<&Extension>
pub fn lookup(&self, id: u8) -> Option<&Extension>
Look up the extension for the id.
The id must be in 1..=MAX_ID (1-indexed).
sourcepub fn id_of(&self, e: Extension) -> Option<u8>
pub fn id_of(&self, e: Extension) -> Option<u8>
Finds the id for an extension (if mapped).
The returned id will be 1-based.
sourcepub fn iter(&self) -> impl Iterator<Item = (u8, &Extension)> + '_
pub fn iter(&self) -> impl Iterator<Item = (u8, &Extension)> + '_
Returns an iterator over the elements of the extension map
sourcepub fn iter_by_media_type(
&self,
audio: bool
) -> impl Iterator<Item = (u8, &Extension)> + '_
pub fn iter_by_media_type( &self, audio: bool ) -> impl Iterator<Item = (u8, &Extension)> + '_
Returns an iterator over the audio or video elements of the extension map
sourcepub fn iter_audio(&self) -> impl Iterator<Item = (u8, &Extension)> + '_
pub fn iter_audio(&self) -> impl Iterator<Item = (u8, &Extension)> + '_
Returns an iterator over the audio elements of the extension map
sourcepub fn iter_video(&self) -> impl Iterator<Item = (u8, &Extension)> + '_
pub fn iter_video(&self) -> impl Iterator<Item = (u8, &Extension)> + '_
Returns an iterator over the video elements of the extension map
Trait Implementations§
source§impl Clone for ExtensionMap
impl Clone for ExtensionMap
source§fn clone(&self) -> ExtensionMap
fn clone(&self) -> ExtensionMap
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ExtensionMap
impl Debug for ExtensionMap
source§impl PartialEq for ExtensionMap
impl PartialEq for ExtensionMap
source§fn eq(&self, other: &ExtensionMap) -> bool
fn eq(&self, other: &ExtensionMap) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ExtensionMap
impl StructuralPartialEq for ExtensionMap
Auto Trait Implementations§
impl !RefUnwindSafe for ExtensionMap
impl Send for ExtensionMap
impl Sync for ExtensionMap
impl Unpin for ExtensionMap
impl UnwindSafe for ExtensionMap
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