pub struct Session {
pub id: String,
pub uri: String,
pub transport: RwLock<Option<Transport>>,
pub state: RwLock<SessionState>,
pub timeout_secs: u64,
}Expand description
A single RTSP session (RFC 2326 §3).
Created during SETUP, destroyed by TEARDOWN or TCP disconnect.
Interior mutability via RwLock allows shared references across threads.
Fields§
§id: StringUnique session identifier (16-char hex string).
uri: StringThe RTSP URI this session was created for (from the SETUP request).
transport: RwLock<Option<Transport>>Transport parameters negotiated during SETUP (RFC 2326 §12.39).
state: RwLock<SessionState>Current playback state.
timeout_secs: u64Session timeout in seconds (included in the Session response header).
Implementations§
Source§impl Session
impl Session
Sourcepub fn set_transport(&self, transport: Transport)
pub fn set_transport(&self, transport: Transport)
Set the transport parameters (called during SETUP).
Sourcepub fn get_transport(&self) -> Option<Transport>
pub fn get_transport(&self) -> Option<Transport>
Returns a clone of the transport parameters, if configured.
Sourcepub fn set_state(&self, state: SessionState)
pub fn set_state(&self, state: SessionState)
Transition to a new playback state.
Sourcepub fn get_state(&self) -> SessionState
pub fn get_state(&self) -> SessionState
Returns the current playback state.
Sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Whether this session is actively receiving media.
Sourcepub fn session_header_value(&self) -> String
pub fn session_header_value(&self) -> String
Format the Session response header value per RFC 2326 §12.37.
Example: "0000000000000001;timeout=60"