pub struct StreamHandle { /* private fields */ }Expand description
A handle to a running RTMP streaming session.
This handle manages the lifecycle of both the RTMP server and the FFmpeg streaming context. When dropped, it will attempt to clean up resources.
§Example
ⓘ
let handle = EmbedRtmpServer::stream_builder()
.address("localhost:1935")
.app_name("live")
.stream_key("stream1")
.input_file("video.mp4")
.start()?;
// Wait for streaming to complete
handle.wait()?;Implementations§
Source§impl StreamHandle
impl StreamHandle
Sourcepub fn wait(self) -> Result<(), StreamError>
pub fn wait(self) -> Result<(), StreamError>
Waits for the streaming session to complete.
This method blocks until the FFmpeg context finishes processing (e.g., when the input file ends or an error occurs).
§Returns
Returns Ok(()) if streaming completed successfully, or an error
if something went wrong during streaming.
Trait Implementations§
Source§impl Drop for StreamHandle
impl Drop for StreamHandle
Auto Trait Implementations§
impl !RefUnwindSafe for StreamHandle
impl !Sync for StreamHandle
impl !UnwindSafe for StreamHandle
impl Freeze for StreamHandle
impl Send for StreamHandle
impl Unpin for StreamHandle
impl UnsafeUnpin for StreamHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more