pub struct ReconcileCtx<'a> {
pub workspace_root: &'a Path,
pub service: &'a ServiceConfig,
pub component: &'a ServiceComponent,
pub mirror: &'a MirrorConfig,
pub env: &'a str,
pub scope: ProviderScope,
}Expand description
Inputs a reconciler sees for one bring-up.
Fields§
§workspace_root: &'a PathWorkspace root (parent of .yah/). Used to resolve relative paths
on the component.
service: &'a ServiceConfigService that owns the component.
component: &'a ServiceComponentComponent being brought up.
mirror: &'a MirrorConfigMirror manifest the bring-up targets.
env: &'a strEnvironment name (file stem of mirrors/<env>.toml).
scope: ProviderScope(tenant, namespace) this bring-up is scoped to (W206). Credentialed
providers resolve at this scope; defaults to ProviderScope::singleton.
Implementations§
Source§impl<'a> ReconcileCtx<'a>
impl<'a> ReconcileCtx<'a>
Sourcepub fn workload_dir(&self) -> PathBuf
pub fn workload_dir(&self) -> PathBuf
Absolute path to the component’s workload directory (the parent of
workload.toml).
In-tree components resolve to <workspace_root>/<path>. For
git-sourced components (R561-F1, “BYO git”) this points into the
local clone — <source_cache>/<subdir>/<path> — which is empty until
materialize runs (approach A: clone-at-reconcile,
so config load + validation stay offline).
Sourcepub async fn materialize(&self) -> Result<()>
pub async fn materialize(&self) -> Result<()>
Ensure a git-sourced component’s code is present locally before build
(R561-F1, approach A). No-op for in-tree components. Idempotent: clones
on the first call, fetches + re-checks-out the pinned ref thereafter.
Reconcilers MUST call this at the top of up before
reading workload_dir for a remote component.
Sourcepub fn workload_kind(&self) -> Result<String>
pub fn workload_kind(&self) -> Result<String>
Read <workload_dir>/workload.toml and extract just the kind
discriminator.
Why this and not the strongly-typed workload_spec::Workload
parse: the on-disk schema_version = 1 form predates the
SchemaVersion::V1 enum and won’t round-trip through the strong
types until B3 lands (see crates/yah/cloud/src/config.rs test
web_workload_round_trips). Reconcilers only need the kind to
dispatch; per-kind tooling (e.g. mesofact-dev’s
WatchOptions::from_workload) does its own parsing for the
build/out_dir fields it cares about.
Sourcepub fn slot(&self, role: &str) -> Option<&'a MirrorProviderSlot>
pub fn slot(&self, role: &str) -> Option<&'a MirrorProviderSlot>
Look up a provider slot by role (e.g. "static", "compute").
Tries the component-qualified key first ("<role>:<component id>")
before falling back to the bare role. A mirror role is normally
service-wide — one providers.static slot serves every static-kind
component — but a service can declare more than one component with
the same role (e.g. two mesofact-static/mesofact-spa components
sharing one mirror), and those need distinct ports to ever both come
up. The qualified key is how a mirror opts a specific component out
of sharing the bare-role slot:
[providers."static:site"]
kind = "local-static"
port = 4331
[providers."static:app"]
kind = "local-static"
port = 4332A mirror with only the bare role (the common, single-component case) is unaffected — the qualified lookup misses and falls through.
Auto Trait Implementations§
impl<'a> Freeze for ReconcileCtx<'a>
impl<'a> RefUnwindSafe for ReconcileCtx<'a>
impl<'a> Send for ReconcileCtx<'a>
impl<'a> Sync for ReconcileCtx<'a>
impl<'a> Unpin for ReconcileCtx<'a>
impl<'a> UnsafeUnpin for ReconcileCtx<'a>
impl<'a> UnwindSafe for ReconcileCtx<'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> 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