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: StringThe RTP stream identifier: letters, digits, - and _.
direction: RidDirectionThe 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
impl Rid
Sourcepub fn new(id: impl Into<String>, direction: RidDirection) -> Result<Self>
pub fn new(id: impl Into<String>, direction: RidDirection) -> Result<Self>
An a=rid line with no pt= and no restriction.
Sourcepub fn restriction(&self, name: &str) -> Option<Option<&str>>
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”.
Sourcepub fn max_height(&self) -> Option<u64>
pub fn max_height(&self) -> Option<u64>
max-height, in pixels.