pub struct ServerSession { /* private fields */ }Expand description
A driveable RTSP server session (RFC 2326 §A.2).
Implementations§
Source§impl ServerSession
impl ServerSession
Sourcepub fn new(session_ids: impl FnMut() -> u64 + Send + 'static) -> Self
pub fn new(session_ids: impl FnMut() -> u64 + Send + 'static) -> Self
Creates a fresh server session in the Init state.
session_ids is called once per allocated Session id and must return
values from a cryptographically secure random source (RFC 2326 §3.4) —
the id is the only thing tying later requests to this session. The
tokio adapter’s io::AsyncRtspServer::accept supplies the OS RNG.
Sourcepub fn with_session_timeout(self, seconds: u64) -> Self
pub fn with_session_timeout(self, seconds: u64) -> Self
Sets the timeout (seconds) advertised in the Session header on SETUP.
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 allocated session id, once a SETUP has been handled.
Sourcepub fn negotiated_transport(&self) -> Option<&Transport>
pub fn negotiated_transport(&self) -> Option<&Transport>
The negotiated transport, once a SETUP has been handled.
Sourcepub fn handle_request(
&mut self,
data: &[u8],
) -> Result<(Vec<u8>, Vec<ServerEvent>)>
pub fn handle_request( &mut self, data: &[u8], ) -> Result<(Vec<u8>, Vec<ServerEvent>)>
Parses an inbound request and returns the serialized response bytes plus the events produced.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ServerSession
impl !Sync for ServerSession
impl !UnwindSafe for ServerSession
impl Freeze for ServerSession
impl Send for ServerSession
impl Unpin for ServerSession
impl UnsafeUnpin for ServerSession
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