[−][src]Enum mediasoup::data_producer::DataProducer
A data producer represents an endpoint capable of injecting data messages into a mediasoup
Router
.
A data producer can use SCTP (AKA DataChannel) to deliver
those messages, or can directly send them from the Rust application if the data producer was
created on top of a DirectTransport
.
Variants (Non-exhaustive)
Regular(RegularDataProducer)
Data producer created on transport other than
DirectTransport
.
Direct(DirectDataProducer)
Data producer created on DirectTransport
.
Implementations
impl DataProducer
[src]
pub fn id(&self) -> DataProducerId
[src]
Data producer identifier.
pub fn type(&self) -> DataProducerType
[src]
The type of the data producer.
pub fn sctp_stream_parameters(&self) -> Option<SctpStreamParameters>
[src]
The SCTP stream parameters (just if the data producer type is Sctp
).
pub fn label(&self) -> &String
[src]
The data producer label.
pub fn protocol(&self) -> &String
[src]
The data producer sub-protocol.
pub fn app_data(&self) -> &AppData
[src]
Custom application data.
pub fn closed(&self) -> bool
[src]
Whether the data producer is closed.
pub async fn get_stats(&self) -> Result<Vec<DataProducerStat>, RequestError>
[src]
Returns current statistics of the data producer.
Check the RTC Statistics section for more details (TypeScript-oriented, but concepts apply here as well).
pub fn on_transport_close<F: FnOnce() + Send + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when the transport this data producer belongs to is closed for whatever
reason. The producer itself is also closed. A on_data_producer_close
callback is called on
all its associated consumers.
pub fn on_close<F: FnOnce() + Send + 'static>(&self, callback: F) -> HandlerId
[src]
Callback is called when the producer is closed for whatever reason.
pub fn downgrade(&self) -> WeakDataProducer
[src]
Downgrade DataProducer
to WeakDataProducer
instance.
Trait Implementations
impl Clone for DataProducer
[src]
pub fn clone(&self) -> DataProducer
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl From<DirectDataProducer> for DataProducer
[src]
pub fn from(producer: DirectDataProducer) -> Self
[src]
impl From<RegularDataProducer> for DataProducer
[src]
pub fn from(producer: RegularDataProducer) -> Self
[src]
Auto Trait Implementations
impl !RefUnwindSafe for DataProducer
[src]
impl Send for DataProducer
[src]
impl Sync for DataProducer
[src]
impl Unpin for DataProducer
[src]
impl !UnwindSafe for DataProducer
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,