pub struct RtmpStreamSender { /* private fields */ }Expand description
Handle for feeding raw, pre-packaged RTMP chunk bytes to a stream published
via EmbedRtmpServer::<Running>::create_stream_sender. Wraps the internal
channel so callers do not depend on the channel implementation.
Cloneable and multi-producer: every clone feeds the same stream, so several producers can push chunks to one stream concurrently.
Implementations§
Source§impl RtmpStreamSender
impl RtmpStreamSender
Sourcepub fn send(&self, chunk: Vec<u8>) -> Result<()>
pub fn send(&self, chunk: Vec<u8>) -> Result<()>
Sends one already-RTMP-chunk-packaged byte buffer to the stream.
The underlying channel is bounded, so this blocks while the stream’s
queue is full — at its item capacity, or at its byte high-water mark of
undrained chunk bytes — (the server applying backpressure) and returns
once space frees up. Returns
Error::RtmpStreamClosed if the
stream has been torn down — its receiver was dropped because the server
stopped or the stream was removed.
Trait Implementations§
Source§impl Clone for RtmpStreamSender
impl Clone for RtmpStreamSender
Source§fn clone(&self) -> RtmpStreamSender
fn clone(&self) -> RtmpStreamSender
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more