[][src]Struct sdp_types::Media

pub struct Media {
    pub media: String,
    pub port: u16,
    pub num_ports: Option<u16>,
    pub proto: String,
    pub fmt: String,
    pub media_title: Option<String>,
    pub connections: Vec<Connection>,
    pub bandwidths: Vec<Bandwidth>,
    pub key: Option<Key>,
    pub attributes: Vec<Attribute>,
}

Media description.

See RFC 4566 Section 5.14 for more details.

Fields

media: String

Media type, e.g. "audio", "video", "text", "application" or "message".

port: u16

Transport port to which the media is sent.

num_ports: Option<u16>

Number of ports starting at port used for the media.

proto: String

Transport protocol.

fmt: String

Media format description.

media_title: Option<String>

Media title.

connections: Vec<Connection>

Connection data for the media.

bandwidths: Vec<Bandwidth>

Bandwidth information for the media.

key: Option<Key>

Encryption key for the media.

attributes: Vec<Attribute>

Attributes of the media.

Methods

impl Media[src]

pub fn has_attribute(&self, name: &str) -> bool[src]

Checks if the given attribute exists.

pub fn get_first_attribute_value(
    &self,
    name: &str
) -> Result<Option<&str>, AttributeNotFoundError>
[src]

Gets the first value of the given attribute, if existing.

pub fn get_attribute_values<'a>(
    &'a self,
    name: &'a str
) -> Result<impl Iterator<Item = Option<&'a str>> + 'a, AttributeNotFoundError>
[src]

Gets an iterator over all attribute values of the given name, if existing.

Trait Implementations

impl Clone for Media[src]

impl Debug for Media[src]

impl Eq for Media[src]

impl PartialEq<Media> for Media[src]

impl StructuralEq for Media[src]

impl StructuralPartialEq for Media[src]

Auto Trait Implementations

impl RefUnwindSafe for Media

impl Send for Media

impl Sync for Media

impl Unpin for Media

impl UnwindSafe for Media

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.