pub trait RTSPServerExtManual:
    Sealed
    + IsA<RTSPServer>
    + 'static {
    // Provided method
    fn attach(
        &self,
        context: Option<&MainContext>,
    ) -> Result<SourceId, BoolError> { ... }
}

Provided Methods§

source

fn attach(&self, context: Option<&MainContext>) -> Result<SourceId, BoolError>

Attaches self to context. When the mainloop for context is run, the server will be dispatched. When context is None, the default context will be used).

This function should be called when the server properties and urls are fully configured and the server is ready to start.

This takes a reference on self until the source is destroyed. Note that if context is not the default main context as returned by glib::MainContext::default() (or None), [glib::Source::remove()][crate::glib::Source::remove()] cannot be used to destroy the source. In that case it is recommended to use RTSPServerExt::create_source() and attach it to context manually.

§context

a glib::MainContext

§Returns

the ID (greater than 0) for the source within the GMainContext.

Object Safety§

This trait is not object safe.

Implementors§