pub trait HttpOperationAlg<Handler, Inputs, Kind> {
type Endpoint;
// Required method
fn http_operation(&self, handler: Handler) -> Self::Endpoint;
}Expand description
Interprets an operation with its declared HTTP input roles and output kind.
A tagless-final specification states this capability for each endpoint it uses. Application, runtime handles, extraction, and conversion are obligations of the interpreter implementation. Built-in and downstream output kinds use exactly the same capability.
A JSON declaration cannot be justified by a text-output capability:
ⓘ
use alux_ext::ext;
use alux_http::{HttpOperationAlg, HttpOperationExt, HttpRouteAlg, RouteAlg, RouteAlgExt, Routes, TextOut};
#[ext(name = MissingJsonExt)]
impl<This> This
where
This: HttpRouteAlg
+ HttpOperationAlg<(), (), TextOut, Endpoint = <This as RouteAlg>::Endpoint>,
{
fn api(&self) -> Routes<'_, This> {
self.routes().get("/", self.op(()).json())
}
}Required Associated Types§
Required Methods§
Sourcefn http_operation(&self, handler: Handler) -> Self::Endpoint
fn http_operation(&self, handler: Handler) -> Self::Endpoint
Interprets the operation under its declared input and output roles.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".