[−][src]Struct mediasoup::direct_transport::DirectTransport
A direct transport represents a direct connection between the mediasoup Rust process and a
Router
instance in a mediasoup-worker subprocess.
A direct transport can be used to directly send and receive data messages from/to Rust by means
of DataProducer
s and DataConsumer
s of type Direct
created on a direct transport.
Direct messages sent by a DataProducer
in a direct transport can be consumed by endpoints
connected through a SCTP capable transport (WebRtcTransport
,
PlainTransport
, PipeTransport
and also by the Rust application by means of a DataConsumer
created on a DirectTransport
(and vice-versa: messages sent over SCTP/DataChannel can be consumed by the Rust application by
means of a DataConsumer
created on a DirectTransport
).
A direct transport can also be used to inject and directly consume RTP and RTCP packets in Rust
by using the DirectProducer::send
and
Consumer::on_rtp
API (plus DirectTransport::send_rtcp
and DirectTransport::on_rtcp
API).
Implementations
impl DirectTransport
[src]
pub async fn send_rtcp(
&self,
rtcp_packet: Bytes
) -> Result<(), NotificationError>
[src]
&self,
rtcp_packet: Bytes
) -> Result<(), NotificationError>
Send a RTCP packet from the Rust process.
rtcp_packet
- Bytes containing a valid RTCP packet (can be a compound packet).
pub fn on_rtcp<F: Fn(&Bytes) + Send + Sync + 'static>(
&self,
callback: F
) -> HandlerId
[src]
&self,
callback: F
) -> HandlerId
Callback is called when the direct transport receives a RTCP packet from its router.
Trait Implementations
impl Clone for DirectTransport
[src]
pub fn clone(&self) -> DirectTransport
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Transport for DirectTransport
[src]
pub fn id(&self) -> TransportId
[src]
Transport id.
pub fn router_id(&self) -> RouterId
[src]
pub fn app_data(&self) -> &AppData
[src]
Custom application data.
pub fn closed(&self) -> bool
[src]
pub fn produce<'life0, 'async_trait>(
&'life0 self,
producer_options: ProducerOptions
) -> Pin<Box<dyn Future<Output = Result<Producer, ProduceError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
producer_options: ProducerOptions
) -> Pin<Box<dyn Future<Output = Result<Producer, ProduceError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Create a Producer.
Transport will be kept alive as long as at least one producer instance is alive.
pub fn consume<'life0, 'async_trait>(
&'life0 self,
consumer_options: ConsumerOptions
) -> Pin<Box<dyn Future<Output = Result<Consumer, ConsumeError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
consumer_options: ConsumerOptions
) -> Pin<Box<dyn Future<Output = Result<Consumer, ConsumeError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Create a Consumer.
Transport will be kept alive as long as at least one consumer instance is alive.
pub fn produce_data<'life0, 'async_trait>(
&'life0 self,
data_producer_options: DataProducerOptions
) -> Pin<Box<dyn Future<Output = Result<DataProducer, ProduceDataError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
data_producer_options: DataProducerOptions
) -> Pin<Box<dyn Future<Output = Result<DataProducer, ProduceDataError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Create a DataProducer.
Transport will be kept alive as long as at least one data producer instance is alive.
pub fn consume_data<'life0, 'async_trait>(
&'life0 self,
data_consumer_options: DataConsumerOptions
) -> Pin<Box<dyn Future<Output = Result<DataConsumer, ConsumeDataError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
data_consumer_options: DataConsumerOptions
) -> Pin<Box<dyn Future<Output = Result<DataConsumer, ConsumeDataError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Create a DataConsumer.
Transport will be kept alive as long as at least one data consumer instance is alive.
pub fn enable_trace_event<'life0, 'async_trait>(
&'life0 self,
types: Vec<TransportTraceEventType>
) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
types: Vec<TransportTraceEventType>
) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations
impl !RefUnwindSafe for DirectTransport
[src]
impl Send for DirectTransport
[src]
impl Sync for DirectTransport
[src]
impl Unpin for DirectTransport
[src]
impl !UnwindSafe for DirectTransport
[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>,