pub trait ServiceSpawnExt {
// Required methods
fn start<S: Service>(&self, service: S) -> Addr<S::Interface>;
fn start_with<S: Service>(&self, service: S, rx: Receiver<S::Interface>);
}
Expand description
Extension trait for ServiceSpawn
, providing more convenient methods to spawn a service.
Required Methods§
Sourcefn start<S: Service>(&self, service: S) -> Addr<S::Interface>
fn start<S: Service>(&self, service: S) -> Addr<S::Interface>
Starts a service and starts tracking its join handle, exposing an Addr
for message passing.
Sourcefn start_with<S: Service>(&self, service: S, rx: Receiver<S::Interface>)
fn start_with<S: Service>(&self, service: S, rx: Receiver<S::Interface>)
Starts a service and starts tracking its join handle, given a predefined receiver.
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.