Trait Server
pub trait Server<Error, InputStreamError = Error, OutputStreamError = Error> {
type Request: Req<Error, InputStreamError, OutputStreamError, WebsocketResponse = Self::Response> + Send + 'static;
type Response: Res + TryRes<Error> + Send + 'static;
// Required method
fn spawn(
future: impl Future<Output = ()> + Send + 'static,
) -> Result<(), Error>;
}
Expand description
A server defines a pair of request/response types and the logic to spawn an async task.
This trait is implemented for any server backend for server functions including
axum
and actix-web
. It should almost never be necessary to implement it
yourself, unless you’re trying to use an alternative HTTP server.
Required Associated Types§
Required Methods§
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.