Skip to main content

Rid

Struct Rid 

Source
pub struct Rid {
    pub id: String,
    pub direction: RidDirection,
    pub formats: Vec<u8>,
    pub restrictions: Vec<(String, Option<String>)>,
}
Expand description

a=rid:<rid-id> <direction> [pt=<fmt-list>;]<restriction>=<value>;... (RFC 8851 section 10).

rid-syntax        = %s"a=rid:" rid-id SP rid-dir [ rid-pt-param-list / rid-param-list ]
rid-id            = 1*(alpha-numeric / "-" / "_")
rid-pt-param-list = SP rid-fmt-list *(";" rid-param)
rid-param-list    = SP rid-param *(";" rid-param)
rid-fmt-list      = %s"pt=" fmt *( "," fmt )

The restrictions RFC 8851 section 5 defines have accessors (max_width() and the others); any other name[=value] is kept in Rid::restrictions, in the order written, so that it can be recognised or refused by whoever knows it (section 6.2: an answerer discards an a=rid line with a restriction it does not understand).

Fields§

§id: String

The RTP stream identifier: letters, digits, - and _.

§direction: RidDirection

The direction the restrictions apply in.

§formats: Vec<u8>

The pt= list: the payload types the stream may use. Empty when there is no pt=, which means any payload type of the media section.

§restrictions: Vec<(String, Option<String>)>

Every restriction but pt=, as (name, value), in order. No name occurs twice.

Implementations§

Source§

impl Rid

Source

pub fn new(id: impl Into<String>, direction: RidDirection) -> Result<Self>

An a=rid line with no pt= and no restriction.

Source

pub fn restriction(&self, name: &str) -> Option<Option<&str>>

The value of the restriction name. The outer None is “not present”; the inner one is “present without a value”.

Source

pub fn max_width(&self) -> Option<u64>

max-width, in pixels.

Source

pub fn max_height(&self) -> Option<u64>

max-height, in pixels.

Source

pub fn max_fps(&self) -> Option<u64>

max-fps, in frames per second.

Source

pub fn max_fs(&self) -> Option<u64>

max-fs, the frame size in pixels per frame.

Source

pub fn max_br(&self) -> Option<u64>

max-br, in bits per second.

Source

pub fn max_pps(&self) -> Option<u64>

max-pps, in pixels per second.

Source

pub fn max_bpp(&self) -> Option<f64>

max-bpp, in bits per pixel.

Source

pub fn depend(&self) -> Vec<&str>

depend: the rid-ids this stream depends on. Empty when there is none.

Trait Implementations§

Source§

impl Clone for Rid

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Rid

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Rid

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Rid

Source§

impl PartialEq for Rid

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Rid

Source§

impl TypedAttribute for Rid

Source§

const NAME: &'static str = "rid"

The attribute name, as it follows a=.
Source§

fn parse(value: &str) -> Result<Self>

Parses the value: everything after a=<name>:.
Source§

fn to_attribute(&self) -> Attribute

The a= line this value makes.

Auto Trait Implementations§

§

impl Forget for Rid

§

impl Freeze for Rid

§

impl Move for Rid

§

impl RefUnwindSafe for Rid

§

impl Send for Rid

§

impl Sync for Rid

§

impl Unpin for Rid

§

impl UnsafeUnpin for Rid

§

impl UnwindSafe for Rid

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.