Trait RTSP Server Ext
Source pub trait RTSPServerExt: IsA<RTSPServer> + 'static {
Show 29 methods
// Provided methods
fn client_filter(
&self,
func: Option<&mut dyn FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult>,
) -> Vec<RTSPClient> { ... }
fn create_socket(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<Socket, Error> { ... }
fn create_source(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<Source, Error> { ... }
fn address(&self) -> Option<GString> { ... }
fn auth(&self) -> Option<RTSPAuth> { ... }
fn backlog(&self) -> i32 { ... }
fn bound_port(&self) -> i32 { ... }
fn content_length_limit(&self) -> u32 { ... }
fn mount_points(&self) -> Option<RTSPMountPoints> { ... }
fn service(&self) -> GString { ... }
fn session_pool(&self) -> Option<RTSPSessionPool> { ... }
fn thread_pool(&self) -> Option<RTSPThreadPool> { ... }
fn set_address(&self, address: &str) { ... }
fn set_auth(&self, auth: Option<&impl IsA<RTSPAuth>>) { ... }
fn set_backlog(&self, backlog: i32) { ... }
fn set_content_length_limit(&self, limit: u32) { ... }
fn set_mount_points(&self, mounts: Option<&impl IsA<RTSPMountPoints>>) { ... }
fn set_service(&self, service: &str) { ... }
fn set_session_pool(&self, pool: Option<&impl IsA<RTSPSessionPool>>) { ... }
fn set_thread_pool(&self, pool: Option<&impl IsA<RTSPThreadPool>>) { ... }
fn transfer_connection(
&self,
socket: impl IsA<Socket>,
ip: &str,
port: i32,
initial_buffer: Option<&str>,
) -> Result<(), BoolError> { ... }
fn connect_client_connected<F: Fn(&Self, &RTSPClient) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_bound_port_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_content_length_limit_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_service_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Expand description
Provided Methods§
Sourcefn client_filter(
&self,
func: Option<&mut dyn FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult>,
) -> Vec<RTSPClient>
fn client_filter( &self, func: Option<&mut dyn FnMut(&RTSPServer, &RTSPClient) -> RTSPFilterResult>, ) -> Vec<RTSPClient>
Call func for each client managed by self. The result value of func
determines what happens to the client. func will be called with self
locked so no further actions on self can be performed from func.
If func returns RTSPFilterResult::Remove, the client will be removed from
self.
If func returns RTSPFilterResult::Keep, the client will remain in self.
If func returns RTSPFilterResult::Ref, the client 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 each client.
§func
a callback
§Returns
a GList with all
clients for which func returned RTSPFilterResult::Ref. After usage, each
element in the GList should be unreffed before the list is freed.
Sourcefn create_socket(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<Socket, Error>
fn create_socket( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Socket, Error>
Create a gio::Socket for self. The socket will listen on the
configured service.
§cancellable
§Returns
the gio::Socket for self or None when an error
occurred.
Sourcefn create_source(
&self,
cancellable: Option<&impl IsA<Cancellable>>,
) -> Result<Source, Error>
fn create_source( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Source, Error>
Create a glib::Source for self. The new source will have a default
GSocketSourceFunc of RTSPServer::io_func().
cancellable if not None can be used to cancel the source, which will cause
the source to trigger, reporting the current condition (which is likely 0
unless cancellation happened at the same time as a condition change). You can
check for this in the callback using [CancellableExtManual::is_cancelled()][crate::gio::prelude::CancellableExtManual::is_cancelled()].
This takes a reference on self until source is destroyed.
§cancellable
a gio::Cancellable or None.
§Returns
the glib::Source for self or None when an error
occurred. Free with g_source_unref ()
Sourcefn address(&self) -> Option<GString>
fn address(&self) -> Option<GString>
Get the address on which the server will accept connections.
§Returns
the server address. g_free() after usage.
Sourcefn bound_port(&self) -> i32
fn bound_port(&self) -> i32
Sourcefn content_length_limit(&self) -> u32
fn content_length_limit(&self) -> u32
Sourcefn mount_points(&self) -> Option<RTSPMountPoints>
fn mount_points(&self) -> Option<RTSPMountPoints>
Get the RTSPMountPoints used as the mount points of self.
§Returns
the RTSPMountPoints of self. g_object_unref() after
usage.
Sourcefn service(&self) -> GString
fn service(&self) -> GString
Get the service on which the server will accept connections.
§Returns
the service. use g_free() after usage.
Sourcefn session_pool(&self) -> Option<RTSPSessionPool>
fn session_pool(&self) -> Option<RTSPSessionPool>
Get the RTSPSessionPool used as the session pool of self.
§Returns
the RTSPSessionPool used for sessions. g_object_unref() after
usage.
Sourcefn thread_pool(&self) -> Option<RTSPThreadPool>
fn thread_pool(&self) -> Option<RTSPThreadPool>
Get the RTSPThreadPool used as the thread pool of self.
§Returns
the RTSPThreadPool of self. g_object_unref() after
usage.
Sourcefn set_address(&self, address: &str)
fn set_address(&self, address: &str)
Configure self to accept connections on the given address.
This function must be called before the server is bound.
§address
the address
Sourcefn set_backlog(&self, backlog: i32)
fn set_backlog(&self, backlog: i32)
configure the maximum amount of requests that may be queued for the server.
This function must be called before the server is bound.
§backlog
the backlog
Sourcefn set_content_length_limit(&self, limit: u32)
fn set_content_length_limit(&self, limit: u32)
Define an appropriate request size limit and reject requests exceeding the limit.
Sourcefn set_mount_points(&self, mounts: Option<&impl IsA<RTSPMountPoints>>)
fn set_mount_points(&self, mounts: Option<&impl IsA<RTSPMountPoints>>)
Sourcefn set_service(&self, service: &str)
fn set_service(&self, service: &str)
Configure self to accept connections on the given service.
service should be a string containing the service name (see services(5)) or
a string containing a port number between 1 and 65535.
When service is set to “0”, the server will listen on a random free
port. The actual used port can be retrieved with
bound_port().
This function must be called before the server is bound.
§service
the service
Sourcefn set_session_pool(&self, pool: Option<&impl IsA<RTSPSessionPool>>)
fn set_session_pool(&self, pool: Option<&impl IsA<RTSPSessionPool>>)
Sourcefn set_thread_pool(&self, pool: Option<&impl IsA<RTSPThreadPool>>)
fn set_thread_pool(&self, pool: Option<&impl IsA<RTSPThreadPool>>)
Sourcefn transfer_connection(
&self,
socket: impl IsA<Socket>,
ip: &str,
port: i32,
initial_buffer: Option<&str>,
) -> Result<(), BoolError>
fn transfer_connection( &self, socket: impl IsA<Socket>, ip: &str, port: i32, initial_buffer: Option<&str>, ) -> Result<(), BoolError>
Take an existing network socket and use it for an RTSP connection. This
is used when transferring a socket from an HTTP server which should be used
as an RTSP over HTTP tunnel. The initial_buffer contains any remaining data
that the HTTP server read from the socket while parsing the HTTP header.
§socket
a network socket
§ip
the IP address of the remote client
§port
the port used by the other end
§initial_buffer
any initial data that was already read from the socket
§Returns
TRUE if all was ok, FALSE if an error occurred.
fn connect_client_connected<F: Fn(&Self, &RTSPClient) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_address_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_bound_port_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_content_length_limit_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_service_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.