pub struct MirrorConfig {
pub schema_version: u32,
pub shape: MirrorShape,
pub ingress: IngressProvider,
pub providers: BTreeMap<String, MirrorProviderSlot>,
pub drivers: BTreeMap<String, MirrorProviderSlot>,
pub asset_aliases: BTreeMap<String, String>,
}Expand description
A service mirror — the projection of a ServiceConfig onto concrete
infra. Lives at .yah/services/<svc>/mirrors/<env>.toml.
Fields§
§schema_version: u32§shape: MirrorShape§ingress: IngressProviderPublic-ingress provider fronting this mirror (W267). Defaults to
IngressProvider::None.
Declared at mirror scope rather than per provider slot because a front
door does fan-in: one cloudflared (or one passway) on a node
multiplexes every hostname→port rule the mirror needs, so pinning it to
a single slot would mint one edge connection per slot for no gain.
providers: BTreeMap<String, MirrorProviderSlot>Provider slots, keyed by role ("static", "compute", …). Each value
either references a provider declared under .yah/infra/providers/ or
inlines a local-only provider (no creds, no infra file).
drivers: BTreeMap<String, MirrorProviderSlot>Capability→driver bindings, keyed by capability ("pg", "s3", …)
rather than by slot role (W265 §Drivers).
This is the generalization of Self::providers: providers.static /
providers.object_store are the special case where the slot name and
the capability happen to coincide, and keying by capability is what stops
the slot enum growing one arm per tier-specific implementation. A service
says “I need pg”; the mirror says which implementation of pg this tier
uses; the app talks the same wire protocol either way and never forks.
[drivers.pg]
kind = "local-pg-dev" # dev — kamaji-supervised loopback postgresAdditive in P1: drivers lands alongside providers, and migrating
the existing providers.static / providers.object_store declarations
over is a separate pass (W265 §“Open follow-ups”). A mirror that declares
neither is unchanged.
asset_aliases: BTreeMap<String, String>Per-environment alias overrides for kind = "static-asset" components.
Keys are logical names (e.g. "whisper-default"); values must be
filenames present in the component’s workload.toml catalog.
Resolution only — this table may never introduce a filename absent
from the catalog. Validated against the workload catalog at sync time.
Implementations§
Source§impl MirrorConfig
impl MirrorConfig
Sourcepub fn driver(&self, capability: Capability) -> Option<&MirrorProviderSlot>
pub fn driver(&self, capability: Capability) -> Option<&MirrorProviderSlot>
The driver bound to capability in this mirror, if any.
None means the tier declares no implementation. In P1 that’s simply
“this mirror doesn’t use that capability”; P2’s binding-error surface is
what turns it into a diagnosable failure for a service that needs it.
Source§impl MirrorConfig
impl MirrorConfig
Sourcepub fn save(
&self,
workspace_root: &Path,
service: &str,
env: &str,
) -> Result<()>
pub fn save( &self, workspace_root: &Path, service: &str, env: &str, ) -> Result<()>
Persist to .yah/services/<service>/mirrors/<env>.toml, creating the
mirrors/ directory if needed. Create-or-overwrite. The mirror file is
named by env (its stem); service selects the owning service dir.
Sourcepub fn delete(workspace_root: &Path, service: &str, env: &str) -> Result<bool>
pub fn delete(workspace_root: &Path, service: &str, env: &str) -> Result<bool>
Remove .yah/services/<service>/mirrors/<env>.toml. Returns false
when the file was already absent. Leaves the service and its other
mirrors untouched.
Also checks legacy stems (e.g. local-sim when env = "pond") so
deleting a canonical tier name removes whichever file exists on disk.
Trait Implementations§
Source§impl Clone for MirrorConfig
impl Clone for MirrorConfig
Source§fn clone(&self) -> MirrorConfig
fn clone(&self) -> MirrorConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MirrorConfig
impl Debug for MirrorConfig
Source§impl<'de> Deserialize<'de> for MirrorConfig
impl<'de> Deserialize<'de> for MirrorConfig
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 MirrorConfig
impl RefUnwindSafe for MirrorConfig
impl Send for MirrorConfig
impl Sync for MirrorConfig
impl Unpin for MirrorConfig
impl UnsafeUnpin for MirrorConfig
impl UnwindSafe for MirrorConfig
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> 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