Skip to main content

ChildProviders

Trait ChildProviders 

Source
pub trait ChildProviders: Send + Sync {
    // Required methods
    fn routes(&self) -> Vec<RouteInfo>;
    fn default_route(&self) -> String;
    fn provider(&self, route: &str) -> Result<ChildRoute, String>;

    // Provided method
    fn refusal(&self, _route: &str) -> Option<String> { ... }
}
Expand description

Where children get their providers. A trait so the tool can be tested without a server and so it never holds the configuration itself.

Required Methods§

Source

fn routes(&self) -> Vec<RouteInfo>

The routes a call may name, in the order they are listed to the model.

Source

fn default_route(&self) -> String

The route a call that names none goes to.

Source

fn provider(&self, route: &str) -> Result<ChildRoute, String>

A provider for route, fresh for this child: a provider holds the usage of its last request, so two children sharing one would read each other’s cost.

Provided Methods§

Source

fn refusal(&self, _route: &str) -> Option<String>

Why route cannot be used here even though it exists. Only a pin has something to say: answering “unknown route” about a route the user did configure would send the model hunting for a name it already knows.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§