pub struct EffectCtx<'a> {
pub runner: &'a dyn CommandRunner,
pub clock: &'a dyn Clock,
pub registry: &'a dyn RegistryQuery,
pub repo_root: &'a Path,
pub artifacts: &'a ReleaseArtifacts,
}Expand description
The injected effect context every ReleaseAdapter method operates through.
Bundles the ADR-0001 ports an adapter is allowed to reach plus the repository root used as the working directory for every command. Holding only trait references keeps adapters testable with recording fakes and unable to touch the real filesystem, network, or clock directly.
Fields§
§runner: &'a dyn CommandRunnerRuns external commands (package-manager / registry CLIs). The single seam an adapter shells out through.
clock: &'a dyn ClockSupplies publish timestamps for PublishReceipt as journaled facts.
registry: &'a dyn RegistryQueryRead-only registry lookups backing verify’s remote reconcile.
repo_root: &'a PathRepository root — the working directory every command runs in.
artifacts: &'a ReleaseArtifactsThe concrete release artifacts threaded from build-all into publish-all
(ADR-0002 §2) — the asset upload set and the source tarball a distribution
adapter repackages. [ReleaseArtifacts::EMPTY] during the re-runnable
dry-run / build phases (the artifacts are not yet known) and for every
non-publish caller; the coordinator swaps in the computed value for the
publish phase (via EffectCtx::with_artifacts) so a publish body can
read it without re-deriving it.
Implementations§
Source§impl<'a> EffectCtx<'a>
impl<'a> EffectCtx<'a>
Sourcepub fn with_artifacts(&self, artifacts: &'a ReleaseArtifacts) -> EffectCtx<'a>
pub fn with_artifacts(&self, artifacts: &'a ReleaseArtifacts) -> EffectCtx<'a>
The same effect context with artifacts swapped in — how the coordinator
hands the computed release artifacts to the publish phase without manually
re-threading every port (a new port added to EffectCtx is carried here
automatically via the ..*self update).