pub trait ServerEndpoint<C>: Endpoint<C> {
// Required methods
fn auth() -> AsyncHandler<HeaderMap, Result<C, Error>>;
fn handler( ) -> AsyncHandler3<C, HeaderMap, <Self as Endpoint<C>>::Data, Result<<Self as Endpoint<C>>::Returns>>;
// Provided methods
fn is_raw() -> bool { ... }
fn stream_handler( ) -> Option<AsyncHandler3<C, HeaderMap, <Self as Endpoint<C>>::Data, Result<ResponseStream>>> { ... }
}Expand description
Server wiring for a single endpoint. Implemented automatically by #[endpoint].
Provides the auth function, the request handler, and flags for raw/streaming modes.
Required Methods§
Provided Methods§
Sourcefn is_raw() -> bool
fn is_raw() -> bool
Returns true for #[endpoint(raw)] endpoints whose response bytes
are returned as-is rather than JSON-serialised.
Sourcefn stream_handler() -> Option<AsyncHandler3<C, HeaderMap, <Self as Endpoint<C>>::Data, Result<ResponseStream>>>
fn stream_handler() -> Option<AsyncHandler3<C, HeaderMap, <Self as Endpoint<C>>::Data, Result<ResponseStream>>>
Returns the streaming handler for #[endpoint(stream)] endpoints,
or None for non-streaming endpoints.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".