Skip to main content

BindingResolver

Trait BindingResolver 

Source
pub trait BindingResolver:
    Send
    + Sync
    + 'static {
    // Required method
    fn resolve(&self, request: &RouteRequest<'_>) -> Resolution;
}
Expand description

Resolves the op a request addresses.

Use super::RestBindingResolver or super::RpcBindingResolver unless the router is mounted in a way they cannot see through.

What the layer enforces whatever this returns: it is called exactly once per request, and the request and the response are bound with the same ResolvedRoute, so a resolver cannot make the two disagree. A wrong answer can only make verification fail (the client bound something else), fail closed under Required (Resolution::Unresolved), or, by returning Resolution::NotAnOp for a real op, let plain traffic to it through; it can never make an unverified envelope pass.

Required Methods§

Source

fn resolve(&self, request: &RouteRequest<'_>) -> Resolution

The op request addresses, if it is one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§