pub trait ServerConfiguration:
Send
+ Clone
+ 'static {
type Item: Send + 'static;
type Service: Service<(), Self::Item, Res = (), Error = ()> + 'static;
// Required method
async fn create(&self) -> Result<Self::Service>;
// Provided methods
fn pause(&self) { ... }
fn resume(&self) { ... }
fn terminate(&self) { ... }
async fn stop(&self) { ... }
}Expand description
Worker service configuration.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn pause(&self)
fn pause(&self)
Called when the server is paused.
Besides explicit Server::pause calls, the server pauses itself
while no worker is available to accept items.
Sourcefn resume(&self)
fn resume(&self)
Called when the server is resumed.
Besides explicit Server::resume calls, the server resumes itself
once a worker becomes available again.
Sourcefn terminate(&self)
fn terminate(&self)
Called when the server’s command loop exits.
This happens after a stop requested through Server::stop or a
signal, graceful or not, once stop has completed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<Cfg: ServerAppConfig> ServerConfiguration for StreamServer<Cfg>
Worker service factory.
impl<Cfg: ServerAppConfig> ServerConfiguration for StreamServer<Cfg>
Worker service factory.