pub enum WorkerAssets<'a> {
Deployed(&'a str),
PerComponent {
cdn_base: &'a str,
env: &'a str,
},
Unplaced,
}Expand description
How the Worker arm resolves a static route’s origin (R898-T4).
Two shapes because the Worker arm is configured from two sources that
differ in exactly this: a mirror’s static slot carries ONE deployed
asset_origin field, while a domain manifest carries a component ref per
route. Collapsing both to the deployed string is what made a second static
route meaningless — every entry would resolve to the same origin, which is
plan_domain_worker’s find_map-the-first defect wearing a table.
Variants§
Deployed(&'a str)
Every static route serves from this one origin — the mirror-driven
path, where the slot’s asset_origin field IS the answer.
PerComponent
Each static route serves from its own component’s published prefix. The alias tier (R561-F3), and the several-buckets-behind-one-domain case R560-F13 asked for: the routes name different services, so they resolve to different origins.
Fields
Unplaced
No CDN tier is known — a manifest-only Worker deployed by the domain pass (R560-F13). A component static route has no origin under this and the compile refuses it naming the route; bucket, backend and redirect routes need no asset placement and compile as usual.
Implementations§
Source§impl WorkerAssets<'_>
impl WorkerAssets<'_>
Sourcepub fn fallback_origin(&self, domain: Option<&DomainConfig>) -> Option<String>
pub fn fallback_origin(&self, domain: Option<&DomainConfig>) -> Option<String>
The ASSET_ORIGIN binding value: where a path that NO table entry
claims is fetched from.
For Self::Deployed that is the deployed origin, domain or no domain.
For Self::PerComponent it is the FIRST static route’s origin — not
because first-wins is back, but because ASSET_ORIGIN is a single
binding and a domain with a static catch-all resolves it to the same
string either way. Every static route still gets its own entry in the
table, which is what the door actually matches on.
None means no path falls through to an HTTP asset origin: no domain,
no component static route (bucket routes read through R2 bindings, not
an origin), a static route whose component ref is malformed, or
Self::Unplaced.
Self::Deployed is returned VERBATIM, trailing slash and all, while
RoutePlacement::asset_origin trims it for the table. That asymmetry
is deliberate and load-bearing: the ASSET_ORIGIN binding is a live
deployed value read off a mirror’s static slot, and R898-T4 is not the
change that quietly renormalizes it under every Worker on the fleet.
Trait Implementations§
Source§impl<'a> Clone for WorkerAssets<'a>
impl<'a> Clone for WorkerAssets<'a>
Source§fn clone(&self) -> WorkerAssets<'a>
fn clone(&self) -> WorkerAssets<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for WorkerAssets<'a>
Auto Trait Implementations§
impl<'a> Freeze for WorkerAssets<'a>
impl<'a> RefUnwindSafe for WorkerAssets<'a>
impl<'a> Send for WorkerAssets<'a>
impl<'a> Sync for WorkerAssets<'a>
impl<'a> Unpin for WorkerAssets<'a>
impl<'a> UnsafeUnpin for WorkerAssets<'a>
impl<'a> UnwindSafe for WorkerAssets<'a>
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,
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