pub struct FrozenProcess { /* private fields */ }Expand description
A structurally immutable projection produced at the composition freeze boundary.
use rustclamp_core::ModuleId;
use rustclamp_kernel::FrozenProcess;
fn mutate(frozen: &mut FrozenProcess) {
frozen.add_module(ModuleId::new("late.module"));
}Implementations§
Source§impl FrozenProcess
impl FrozenProcess
Sourcepub const fn runtime(&self) -> &RuntimeProjection
pub const fn runtime(&self) -> &RuntimeProjection
Returns the compact runtime projection derived from the resolved model.
Sourcepub const fn inspection(&self) -> &ProcessProjection
pub const fn inspection(&self) -> &ProcessProjection
Returns immutable resolution metadata for inspection.
Sourcepub fn resolve<'value, C: Capability>(
&self,
consumer: ModuleId,
provisions: &[Provision<'value, C>],
) -> Result<&'value C::Value, CompositionError>
pub fn resolve<'value, C: Capability>( &self, consumer: ModuleId, provisions: &[Provision<'value, C>], ) -> Result<&'value C::Value, CompositionError>
Resolves consumer’s unqualified requirement for C to the value of the
provider this process selected at freeze time.
The blueprint stays the single declaration of the edge: the caller supplies
only the constructed values. An undeclared or inactive optional requirement
fails with CompositionErrorKind::UndeclaredRequirement; a selected provider
missing from provisions fails with
CompositionErrorKind::ProviderSelectionUnavailable.
Like FrozenProcess::resolve, but returns an owned Arc handle.
The value can outlive the provisions slice and be moved into 'static
state (a server, a spawned task) without Box::leak.
Sourcepub fn resolve_with<C: Capability, E>(
&self,
consumer: ModuleId,
provisions: Vec<FactoryProvision<C, E>>,
) -> Result<Arc<C::Value>, FactoryError<E>>
pub fn resolve_with<C: Capability, E>( &self, consumer: ModuleId, provisions: Vec<FactoryProvision<C, E>>, ) -> Result<Arc<C::Value>, FactoryError<E>>
Builds the value of the provider this process selected, after freeze.
Only the selected provider’s factory runs, so a provider whose
construction can fail (opening a database) is built once, and only when
the frozen process actually uses it. A factory failure is returned as
FactoryError::Build.
Sourcepub fn compose<T: ContributionTarget, Q: Qualifier>(
&self,
target: &T,
contributions: Vec<(ModuleId, T::Contribution)>,
) -> Result<T::Runtime, ComposeError<T::Error>>
pub fn compose<T: ContributionTarget, Q: Qualifier>( &self, target: &T, contributions: Vec<(ModuleId, T::Contribution)>, ) -> Result<T::Runtime, ComposeError<T::Error>>
Builds target T (qualifier Q) from the contributions this process selected.
The blueprint’s add_contribution edges stay the single declaration:
contributions from modules outside this process are dropped, and the rest
must match the frozen edges exactly — an included module supplying an
undeclared contribution, or a declared contributor supplying none, fails.
Sourcepub fn compose_inferred<T: ContributionTarget>(
&self,
target: &T,
contributions: Vec<(ModuleId, T::Contribution)>,
) -> Result<T::Runtime, ComposeError<T::Error>>
pub fn compose_inferred<T: ContributionTarget>( &self, target: &T, contributions: Vec<(ModuleId, T::Contribution)>, ) -> Result<T::Runtime, ComposeError<T::Error>>
compose, with the qualifier read from the blueprint’s
add_contribution edges for T instead of named again by the caller.
Fails with ComposeError::AmbiguousQualifier when this process has
edges into T under more than one qualifier, or none: name it with
compose::<T, Q> then.