pub struct ClientSession { /* private fields */ }Expand description
Sans-IO RTMP client publish session.
Implementations§
Source§impl ClientSession
impl ClientSession
Sourcepub fn new(config: ClientConfig) -> Self
pub fn new(config: ClientConfig) -> Self
Create a new client session.
Sourcepub fn start(&mut self) -> Vec<u8> ⓘ
pub fn start(&mut self) -> Vec<u8> ⓘ
Produce C0+C1 handshake bytes. Call once at session start.
Sourcepub fn handle_data(
&mut self,
input: &[u8],
) -> Result<(Vec<u8>, Vec<ClientEvent>), RtmpError>
pub fn handle_data( &mut self, input: &[u8], ) -> Result<(Vec<u8>, Vec<ClientEvent>), RtmpError>
Feed inbound bytes. Returns (outbound bytes, events).
Sourcepub fn send_audio(
&mut self,
timestamp: u32,
data: &[u8],
) -> Result<Vec<u8>, RtmpError>
pub fn send_audio( &mut self, timestamp: u32, data: &[u8], ) -> Result<Vec<u8>, RtmpError>
Encode an audio message (type 8). Only valid in Publishing state.
Sourcepub fn send_video(
&mut self,
timestamp: u32,
data: &[u8],
) -> Result<Vec<u8>, RtmpError>
pub fn send_video( &mut self, timestamp: u32, data: &[u8], ) -> Result<Vec<u8>, RtmpError>
Encode a video message (type 9). Only valid in Publishing state.
Sourcepub fn send_metadata(
&mut self,
metadata: &[(String, Amf0Value)],
) -> Result<Vec<u8>, RtmpError>
pub fn send_metadata( &mut self, metadata: &[(String, Amf0Value)], ) -> Result<Vec<u8>, RtmpError>
Encode a metadata message (@setDataFrame/onMetaData, type 18).
Sourcepub fn is_publishing(&self) -> bool
pub fn is_publishing(&self) -> bool
Whether the session has reached Publishing state.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientSession
impl RefUnwindSafe for ClientSession
impl Send for ClientSession
impl Sync for ClientSession
impl Unpin for ClientSession
impl UnsafeUnpin for ClientSession
impl UnwindSafe for ClientSession
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