pub struct DirectTransport { /* private fields */ }
Expand description

A direct transport represents a direct connection between the mediasoup Rust process and a Router instance in a mediasoup-worker thread.

A direct transport can be used to directly send and receive data messages from/to Rust by means of DataProducers and DataConsumers 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

Send a RTCP packet from the Rust process.

  • rtcp_packet - Bytes containing a valid RTCP packet (can be a compound packet).

Callback is called when the direct transport receives a RTCP packet from its router.

Downgrade DirectTransport to WeakDirectTransport instance.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Transport id.

Router to which transport belongs.

Custom application data.

Whether the transport is closed.

Instructs the router to receive audio or video RTP (or SRTP depending on the transport). This is the way to inject media into mediasoup. Read more

Instructs the router to send audio or video RTP (or SRTP depending on the transport). This is the way to extract media from mediasoup. Read more

Instructs the router to receive data messages. Those messages can be delivered by an endpoint via SCTP protocol (AKA DataChannel in WebRTC) or can be directly sent from the Rust application if the transport is a DirectTransport. Read more

Instructs the router to send data messages to the endpoint via SCTP protocol (AKA DataChannel in WebRTC) or directly to the Rust process if the transport is a DirectTransport. Read more

Instructs the transport to emit “trace” events. For monitoring purposes. Use with caution.

Callback is called when a new producer is created.

Callback is called when a new consumer is created.

Callback is called when a new data producer is created.

Callback is called when a new data consumer is created.

Callback is called when the router this transport belongs to is closed for whatever reason. The transport itself is also closed. on_transport_close callbacks are also called on all its producers and consumers. Read more

Callback is called when the router is closed for whatever reason. Read more

👎 Deprecated:

Use router().id() instead

Router id.

Returns current RTC statistics of the transport.

Check the RTC Statistics section for more details (TypeScript-oriented, but concepts apply here as well).

Stats data structure specific to each transport.

Dump Transport.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.