Skip to main content

RoutePlacement

Trait RoutePlacement 

Source
pub trait RoutePlacement {
    // Required methods
    fn asset_origin(&self, component: &str, path: &str) -> Option<String>;
    fn backend_origin(&self, component: &str, path: &str) -> Option<String>;

    // Provided method
    fn auth_required_prefixes(&self) -> &[String] { ... }
}
Expand description

The placement-time facts a declared route cannot answer about itself.

Two separate methods rather than one origin lookup because the two resolutions have nothing in common: a static route’s origin is a published storage prefix that exists before anything is deployed, and a backend route’s is the address of a running unit. Collapsing them would force every implementor to re-derive the mode from the component ref.

None from either is a refused compile (DomainConfig::route_table), not a skipped entry.

Required Methods§

Source

fn asset_origin(&self, component: &str, path: &str) -> Option<String>

Where a static route’s component publishes its bytes.

path is the route’s own pattern, present for the multi-bucket case (R560-F13) where the prefix, not the component, picks the origin.

Source

fn backend_origin(&self, component: &str, path: &str) -> Option<String>

Where a backend route’s deployed unit is reachable.

Provided Methods§

Source

fn auth_required_prefixes(&self) -> &[String]

Path prefixes the door fronting this domain requires a bearer on — PasswayAuth::require_prefixes, verbatim. Default: an anonymous door, which is every Worker-fronted domain (the Worker arm has no bearer auth at all).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§