pub struct ClientSession { /* private fields */ }Expand description
A driveable RTSP client session (RFC 2326 §A.1).
Implementations§
Source§impl ClientSession
impl ClientSession
Sourcepub fn with_credentials(self, credentials: Credentials) -> Self
pub fn with_credentials(self, credentials: Credentials) -> Self
Attaches credentials so the engine can answer 401 challenges (§14).
Sourcepub fn with_user_agent(self, ua: impl Into<String>) -> Self
pub fn with_user_agent(self, ua: impl Into<String>) -> Self
Overrides the User-Agent header value sent on requests.
Sourcepub fn state(&self) -> SessionState
pub fn state(&self) -> SessionState
The current session state.
Sourcepub fn session_id(&self) -> Option<&str>
pub fn session_id(&self) -> Option<&str>
The negotiated session id, once a SETUP response has been processed.
Sourcepub fn session_timeout(&self) -> Option<u64>
pub fn session_timeout(&self) -> Option<u64>
The session timeout in seconds, if the SETUP response declared one.
Sourcepub fn negotiated_transport(&self) -> Option<&Transport>
pub fn negotiated_transport(&self) -> Option<&Transport>
The transport negotiated in the SETUP response, if any.
Sourcepub fn options(&mut self, uri: &str) -> Result<Vec<u8>>
pub fn options(&mut self, uri: &str) -> Result<Vec<u8>>
Builds an OPTIONS request (state-neutral).
Sourcepub fn describe(&mut self, uri: &str) -> Result<Vec<u8>>
pub fn describe(&mut self, uri: &str) -> Result<Vec<u8>>
Builds a DESCRIBE request with Accept: application/sdp (state-neutral).
Sourcepub fn setup(&mut self, uri: &str, transport: &Transport) -> Result<Vec<u8>>
pub fn setup(&mut self, uri: &str, transport: &Transport) -> Result<Vec<u8>>
Builds a SETUP request carrying the given Transport (Init/Ready/…).
Sourcepub fn play(&mut self, uri: &str) -> Result<Vec<u8>>
pub fn play(&mut self, uri: &str) -> Result<Vec<u8>>
Builds a PLAY request (valid in Ready/Playing).
Sourcepub fn pause(&mut self, uri: &str) -> Result<Vec<u8>>
pub fn pause(&mut self, uri: &str) -> Result<Vec<u8>>
Builds a PAUSE request (valid in Playing/Recording).
Sourcepub fn teardown(&mut self, uri: &str) -> Result<Vec<u8>>
pub fn teardown(&mut self, uri: &str) -> Result<Vec<u8>>
Builds a TEARDOWN request (valid in any non-Init state, and Init).
Sourcepub fn get_parameter(&mut self, uri: &str, body: &[u8]) -> Result<Vec<u8>>
pub fn get_parameter(&mut self, uri: &str, body: &[u8]) -> Result<Vec<u8>>
Builds a GET_PARAMETER request, optionally with a body (state-neutral;
an empty body is the liveness ping).
Sourcepub fn handle_data(&mut self, data: &[u8]) -> Result<Vec<ClientEvent>>
pub fn handle_data(&mut self, data: &[u8]) -> Result<Vec<ClientEvent>>
Feeds inbound bytes and returns the events produced. Retains any partial trailing message or frame internally for the next call.