Skip to main content

RoutingTableSource

Trait RoutingTableSource 

Source
pub trait RoutingTableSource: Send + Sync {
    // Required method
    fn fetch(
        &self,
        sorx_base_url: &str,
        tenant: Option<&str>,
        sor: Option<&str>,
    ) -> Result<Vec<RouteRow>, String>;
}
Expand description

Source of routing-table rows. Sync by design: the deployer’s HTTP stack is reqwest::blocking, and the router runs off the request hot-path behind a TTL cache, so a blocking fetch is appropriate and keeps the trait object-safe and trivially fakeable in tests.

Required Methods§

Source

fn fetch( &self, sorx_base_url: &str, tenant: Option<&str>, sor: Option<&str>, ) -> Result<Vec<RouteRow>, String>

Fetch the routing-table from SoRX. tenant / sor are optional server side filters; passing None fetches the full table. Errors are returned as a String so the resolver can apply stale-on-error without coupling to a concrete error type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§