pub struct SessionContext {
pub session_id: u64,
pub peer_addr: SocketAddr,
pub app: String,
pub encoder_type: EncoderType,
pub connect_params: Option<Arc<ConnectParams>>,
pub stats: SessionStats,
}Expand description
Context passed to RtmpHandler callbacks
Provides read-only access to session information. For operations that modify state, use the return values from handler methods.
Fields§
§session_id: u64Unique session ID
peer_addr: SocketAddrRemote peer address
app: StringApplication name (from connect)
encoder_type: EncoderTypeDetected encoder type
connect_params: Option<Arc<ConnectParams>>Connect parameters (if available)
stats: SessionStatsCurrent session statistics
Implementations§
Source§impl SessionContext
impl SessionContext
Sourcepub fn new(session_id: u64, peer_addr: SocketAddr) -> Self
pub fn new(session_id: u64, peer_addr: SocketAddr) -> Self
Create a new context
Sourcepub fn with_connect(&mut self, params: ConnectParams, encoder_type: EncoderType)
pub fn with_connect(&mut self, params: ConnectParams, encoder_type: EncoderType)
Update with connect parameters
Trait Implementations§
Source§impl Clone for SessionContext
impl Clone for SessionContext
Source§fn clone(&self) -> SessionContext
fn clone(&self) -> SessionContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionContext
impl RefUnwindSafe for SessionContext
impl Send for SessionContext
impl Sync for SessionContext
impl Unpin for SessionContext
impl UnwindSafe for SessionContext
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