pub enum RouteMode {
Static {
component: String,
},
StaticBucket {
bucket: String,
},
Backend {
component: String,
origin: String,
origin_path: Option<String>,
},
Redirect {
target: String,
status: u16,
},
}Expand description
Body of a DomainRoute. Three modes on the wire, four shapes here:
- Static (
mode = "static",component = …) — the door serves a published component’s bytes from its CDN prefix. Component ref points at akind = "mesofact-static"(or similar) service component. - StaticBucket (
mode = "static",bucket = …, R560-F13) — the door serves an R2 bucket’s ROOT, keyed by the request path minus its leading slash with nothing stripped or prepended. For a CDN whose route prefixes ARE its buckets’ top-level key prefixes (cdn.noisetable.com), where xlb derives a blob’s key from the very URL path it serves at, so path == key is an invariant rather than a convention. - Backend — Worker proxies to an HTTP origin owned by a backend component (yubaba workload, gateway, etc.).
- Redirect — Worker emits a 30x to the target URL. Used to keep old paths alive during domain refactors.
The two static shapes are separate variants rather than one variant with
two optional fields, so “both” and “neither” have no spelling in Rust. The
TOML keeps one mode = "static" and the choice between component and
bucket is refused at parse time unless exactly one is present — see
[RouteModeWire].
Variants§
Static
Fields
component: StringComponent reference "<service>/<component-id>". Validated
at CloudConfig::load time.
StaticBucket
Fields
bucket: StringR2 bucket name. Validated against R2’s naming rule at parse time,
which is also what makes crate::route_table::r2_binding_name
injective.
Backend
Fields
component: StringComponent reference "<service>/<component-id>". Validated
at CloudConfig::load time.
origin: StringOrigin URL the Worker fetch()es. Schema-permissive — could
be https://..., wss://..., or a yah-internal mesh URL
resolved by yubaba.
origin_path: Option<String>The path prefix this route’s path becomes at the origin, when the
two differ (R898-F3). /api/issues* with origin_path = "/issues"
proxies /api/issues/42 to <origin>/issues/42.
Absent means an identity proxy — the public path reaches the origin
unchanged. It is declared here rather than derived because it is a
fact about the upstream’s path layout, which this repo does not
own: the issue tracker serves /issues and the almanac serves
/releases, and both are live contracts that predate the domain
manifest. Compiled into RouteRewrite
by DomainConfig::route_table.
Redirect
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RouteMode
impl<'de> Deserialize<'de> for RouteMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RouteMode
impl RefUnwindSafe for RouteMode
impl Send for RouteMode
impl Sync for RouteMode
impl Unpin for RouteMode
impl UnsafeUnpin for RouteMode
impl UnwindSafe for RouteMode
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more