pub trait RTSPSessionPoolExt: IsA<RTSPSessionPool> + Sealed + 'static {
    // Provided methods
    fn cleanup(&self) -> u32 { ... }
    fn create(&self) -> Result<RTSPSession, BoolError> { ... }
    fn filter(
        &self,
        func: Option<&mut dyn FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult>
    ) -> Vec<RTSPSession> { ... }
    fn find(&self, sessionid: &str) -> Option<RTSPSession> { ... }
    fn max_sessions(&self) -> u32 { ... }
    fn n_sessions(&self) -> u32 { ... }
    fn remove(&self, sess: &impl IsA<RTSPSession>) -> Result<(), BoolError> { ... }
    fn set_max_sessions(&self, max: u32) { ... }
    fn connect_session_removed<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId { ... }
    fn connect_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all RTSPSessionPool methods.

§Implementors

RTSPSessionPool

Provided Methods§

source

fn cleanup(&self) -> u32

Inspect all the sessions in self and remove the sessions that are inactive for more than their timeout.

§Returns

the amount of sessions that got removed.

source

fn create(&self) -> Result<RTSPSession, BoolError>

Create a new RTSPSession object in self.

§Returns

a new RTSPSession.

source

fn filter( &self, func: Option<&mut dyn FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult> ) -> Vec<RTSPSession>

Call func for each session in self. The result value of func determines what happens to the session. func will be called with the session pool locked so no further actions on self can be performed from func.

If func returns RTSPFilterResult::Remove, the session will be set to the expired state and removed from self.

If func returns RTSPFilterResult::Keep, the session will remain in self.

If func returns RTSPFilterResult::Ref, the session will remain in self but will also be added with an additional ref to the result GList of this function..

When func is None, RTSPFilterResult::Ref will be assumed for all sessions.

§func

a callback

§Returns

a GList with all sessions for which func returned RTSPFilterResult::Ref. After usage, each element in the GList should be unreffed before the list is freed.

source

fn find(&self, sessionid: &str) -> Option<RTSPSession>

Find the session with sessionid in self. The access time of the session will be updated with RTSPSessionExt::touch().

§sessionid

the session id

§Returns

the RTSPSession with sessionid or None when the session did not exist. g_object_unref() after usage.

source

fn max_sessions(&self) -> u32

Get the maximum allowed number of sessions in self. 0 means an unlimited amount of sessions.

§Returns

the maximum allowed number of sessions.

source

fn n_sessions(&self) -> u32

Get the amount of active sessions in self.

§Returns

the amount of active sessions in self.

source

fn remove(&self, sess: &impl IsA<RTSPSession>) -> Result<(), BoolError>

Remove sess from self, releasing the ref that the pool has on sess.

§sess

a RTSPSession

§Returns

true if the session was found and removed.

source

fn set_max_sessions(&self, max: u32)

Configure the maximum allowed number of sessions in self to max. A value of 0 means an unlimited amount of sessions.

§max

the maximum number of sessions

source

fn connect_session_removed<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§