pub trait AddDaemonExt {
// Required methods
fn add_daemon<T>(&self, daemon: impl Into<Arc<T>>)
where T: Daemon + 'static;
fn has_daemon<T>(&self) -> bool
where T: Daemon + 'static;
}Expand description
Registers concrete Daemon instances on the application.
This extension lives on AppContext, so daemons can be registered both
while configuring the builder and from within a plugin’s build. A daemon is
identified by its type.
Required Methods§
Sourcefn add_daemon<T>(&self, daemon: impl Into<Arc<T>>)where
T: Daemon + 'static,
fn add_daemon<T>(&self, daemon: impl Into<Arc<T>>)where
T: Daemon + 'static,
Registers daemon to be run by RunDaemonsExt::run_daemons.
§Panics
Panics if a daemon of type T is already registered. Guard with
has_daemon when the same type may be
registered more than once.
Sourcefn has_daemon<T>(&self) -> boolwhere
T: Daemon + 'static,
fn has_daemon<T>(&self) -> boolwhere
T: Daemon + 'static,
Returns whether a daemon of type T is registered.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".