#[non_exhaustive]pub struct CodecOffer {
pub name: String,
pub payload_type: u8,
pub clock_rate: Option<u32>,
pub ptime: Option<u32>,
pub bitrate: Option<u32>,
pub channels: Option<u8>,
}Expand description
One codec as FreeSWITCH spells it inside a negotiation trace’s brackets.
Everything past the payload type is None for video, whose trace carries
only name:payload_type.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: String§payload_type: u8§clock_rate: Option<u32>§ptime: Option<u32>§bitrate: Option<u32>§channels: Option<u8>Implementations§
Source§impl CodecOffer
impl CodecOffer
Sourcepub fn parse(media: CodecMedia, token: &str) -> Result<Self, CodecParseError>
pub fn parse(media: CodecMedia, token: &str) -> Result<Self, CodecParseError>
Read a bracket-stripped token, e.g. opus:116:16000:20:0:1 for audio or
H264:109 for video.
The seven-field audio form is switch_core_media.c:5575’s only, which
logs actual_samples_per_second after the rate where its siblings do
not; that extra field is skipped so all audio forms yield the same shape.
Trait Implementations§
Source§impl Clone for CodecOffer
impl Clone for CodecOffer
Source§fn clone(&self) -> CodecOffer
fn clone(&self) -> CodecOffer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CodecOffer
impl Debug for CodecOffer
Source§impl Display for CodecOffer
impl Display for CodecOffer
impl Eq for CodecOffer
Source§impl PartialEq for CodecOffer
impl PartialEq for CodecOffer
impl StructuralPartialEq for CodecOffer
Auto Trait Implementations§
impl Freeze for CodecOffer
impl RefUnwindSafe for CodecOffer
impl Send for CodecOffer
impl Sync for CodecOffer
impl Unpin for CodecOffer
impl UnsafeUnpin for CodecOffer
impl UnwindSafe for CodecOffer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.