pub struct Validated<T, Phase = Runtime>where
Phase: ValidationPhase,{ /* private fields */ }Expand description
Proof that a value was produced by the conformance checker,
not fabricated by Prism code.
The inner value and _sealed field are private, so Validated<T>
can only be constructed within this crate.
v0.2.2 W13: parameterized by a Phase: ValidationPhase discriminator.
Validated<T, CompileTime> was witnessed by validate_const() and is
usable in const contexts. Validated<T, Runtime> (the default) was
witnessed by validate(). A CompileTime witness is convertible to
a Runtime witness via From.
§Examples
use uor_foundation::enforcement::{CompileUnitBuilder, ConstrainedTypeInput, Term};
use uor_foundation::{WittLevel, VerificationDomain};
// Validated<T> proves that a value passed conformance checking.
// You cannot construct one directly — only builder validate() methods
// and the minting boundary produce them.
let terms = [uor_foundation::pipeline::literal_u64(1, WittLevel::W8)];
let domains = [VerificationDomain::Enumerative];
let validated = CompileUnitBuilder::new()
.root_term(&terms)
.witt_level_ceiling(WittLevel::W8)
.thermodynamic_budget(1024)
.target_domains(&domains)
.result_type::<ConstrainedTypeInput>()
.validate()
.expect("all fields set");
// Access the inner value through the proof wrapper:
let _compile_unit = validated.inner();Implementations§
Source§impl<T, Phase> Validated<T, Phase>where
Phase: ValidationPhase,
T: ConstrainedTypeShape,
impl<T, Phase> Validated<T, Phase>where
Phase: ValidationPhase,
T: ConstrainedTypeShape,
Sourcepub const fn as_landauer(&self) -> ValidatedLandauerView<T, Phase>
pub const fn as_landauer(&self) -> ValidatedLandauerView<T, Phase>
Phase 16 — Landauer-cost view of self.
Sourcepub const fn as_jacobian(&self) -> ValidatedJacobianView<T, Phase>
pub const fn as_jacobian(&self) -> ValidatedJacobianView<T, Phase>
Phase 16 — Jacobian view of self.
Sourcepub const fn as_carry_depth(&self) -> ValidatedCarryDepthView<T, Phase>
pub const fn as_carry_depth(&self) -> ValidatedCarryDepthView<T, Phase>
Phase 16 — carry-depth view of self.
Sourcepub const fn as_derivation_depth(
&self,
) -> ValidatedDerivationDepthView<T, Phase>
pub const fn as_derivation_depth( &self, ) -> ValidatedDerivationDepthView<T, Phase>
Phase 16 — derivation-depth view of self.
Sourcepub const fn as_free_rank(&self) -> ValidatedFreeRankView<T, Phase>
pub const fn as_free_rank(&self) -> ValidatedFreeRankView<T, Phase>
Phase 16 — free-rank view of self.
Trait Implementations§
Source§impl<T> Deref for Validated<T>where
T: OntologyTarget,
v0.2.1 Deref impl for Validated<T: OntologyTarget> so consumers can call
certificate methods directly: cert.target_level() rather than
cert.inner().target_level(). The bound T: OntologyTarget keeps the
auto-deref scoped to foundation-produced types.
impl<T> Deref for Validated<T>where
T: OntologyTarget,
v0.2.1 Deref impl for Validated<T: OntologyTarget> so consumers can call
certificate methods directly: cert.target_level() rather than
cert.inner().target_level(). The bound T: OntologyTarget keeps the
auto-deref scoped to foundation-produced types.
Source§impl<T> From<Validated<T, CompileTime>> for Validated<T>
v0.2.2 W13: a compile-time witness is usable wherever a runtime witness is required.
impl<T> From<Validated<T, CompileTime>> for Validated<T>
v0.2.2 W13: a compile-time witness is usable wherever a runtime witness is required.