Skip to main content

RouterPlugin

Trait RouterPlugin 

Source
pub trait RouterPlugin: Send + Sync {
    // Required method
    fn route(
        &self,
        ctx: &RequestContext,
        principal: &Principal,
        candidates: &[UpstreamCandidate],
    ) -> Result<RouteDecision, RouteError>;
}
Expand description

Router plugin boundary.

Required Methods§

Source

fn route( &self, ctx: &RequestContext, principal: &Principal, candidates: &[UpstreamCandidate], ) -> Result<RouteDecision, RouteError>

Selects the upstream and dialect for an authenticated request.

The candidates parameter provides the list of available upstreams that can be selected. Candidates are sorted by upstream_id ascending (Uuid byte order) to enable deterministic routing algorithms.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§