Skip to main content

build_rest_op_resolver

Function build_rest_op_resolver 

Source
pub fn build_rest_op_resolver(
    routes: &'static [RouteTransportDescriptor],
) -> impl Fn(&Request<Body>) + Send + Sync
Expand description

Build an op resolver for REST schemas, over the generated ROUTE_TRANSPORTS slice, for a router mounted at the root.

Matches on the route pattern (/widgets/{id}) rather than the concrete request path (/widgets/42), plus the HTTP method — the two together are what identify a REST op, since one path serves up to three verbs.

Returns OpAdmission::unresolved when MatchedPath is absent (the request hit no route — a 404) or no descriptor matches (a schema/router mismatch). Both still reserve.

If the router is nested, use build_rest_op_resolver_with_prefix — this constructor compares the matched path exactly, so a nested mount misses every lookup.