use crate::enums::VerificationDomain;
use crate::enums::WittLevel;
use crate::HostTypes;
pub trait EulerReduction<H: HostTypes> {
fn phase_parameter(&self) -> &H::HostString;
fn stage_count(&self) -> u64;
fn convergence_angle(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn composed_of_maps(&self) -> &[Self::TermExpression];
}
pub trait PhaseRotationScheduler<H: HostTypes> {
fn rotation_schedule(&self) -> &H::HostString;
fn base_angle(&self) -> &H::HostString;
}
pub trait TargetConvergenceAngle<H: HostTypes> {
fn target_angle(&self) -> &H::HostString;
}
pub trait PhaseGateAttestation<H: HostTypes> {
type ReductionStep: ReductionStep<H>;
fn gate_stage(&self) -> &Self::ReductionStep;
fn gate_expected_phase(&self) -> &H::HostString;
fn gate_result(&self) -> bool;
}
pub trait ComplexConjugateRollback<H: HostTypes> {
type ReductionStep: ReductionStep<H>;
fn rollback_target(&self) -> &Self::ReductionStep;
}
pub trait ReductionStep<H: HostTypes> {
fn stage_index(&self) -> u64;
fn stage_name(&self) -> &H::HostString;
fn expected_phase(&self) -> &H::HostString;
type StatePredicate: crate::kernel::predicate::StatePredicate<H>;
fn entry_guard(&self) -> &Self::StatePredicate;
fn exit_guard(&self) -> &Self::StatePredicate;
type Effect: crate::kernel::effect::Effect<H>;
fn stage_effect(&self) -> &Self::Effect;
}
pub trait ReductionState<H: HostTypes> {
type ReductionStep: ReductionStep<H>;
fn current_stage(&self) -> &Self::ReductionStep;
fn phase_angle(&self) -> &H::HostString;
fn pinned_mask(&self) -> u64;
fn free_rank(&self) -> u64;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn site_state(&self) -> &Self::TermExpression;
}
pub trait ReductionRule<H: HostTypes> {
type GuardedTransition: crate::kernel::predicate::GuardedTransition<H>;
fn transition_guard(&self) -> &Self::GuardedTransition;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn transition_effect(&self) -> &Self::TermExpression;
fn transition_advance(&self) -> bool;
}
pub trait Epoch<H: HostTypes> {
fn epoch_index(&self) -> u64;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn epoch_datum(&self) -> &Self::TermExpression;
}
pub trait EpochBoundary<H: HostTypes> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn epoch_boundary_type(&self) -> &Self::TermExpression;
fn preserved_grounding(&self) -> bool;
}
pub trait PredicateExpression<H: HostTypes> {
fn predicate_field(&self) -> &H::HostString;
fn predicate_operator(&self) -> &H::HostString;
fn predicate_value(&self) -> &H::HostString;
}
pub trait GuardExpression<H: HostTypes> {
type PredicateExpression: PredicateExpression<H>;
fn guard_predicates(&self) -> &[Self::PredicateExpression];
}
pub trait TransitionEffect<H: HostTypes> {
type PropertyBind: PropertyBind<H>;
fn effect_bindings(&self) -> &[Self::PropertyBind];
}
pub trait PropertyBind<H: HostTypes> {
fn bind_target(&self) -> &H::HostString;
fn bind_value(&self) -> &H::HostString;
}
pub trait ReductionAdvance<H: HostTypes> {
type ReductionStep: ReductionStep<H>;
fn advance_from(&self) -> &Self::ReductionStep;
fn advance_to(&self) -> &Self::ReductionStep;
}
pub trait ServiceWindow<H: HostTypes> {
fn window_size(&self) -> u64;
fn window_offset(&self) -> u64;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn base_context_ref(&self) -> &Self::TermExpression;
}
pub trait ReductionTransaction<H: HostTypes> {
fn transaction_policy(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn transaction_outcome(&self) -> &Self::TermExpression;
fn transaction_scope(&self) -> &Self::TermExpression;
fn transaction_status(&self) -> &Self::TermExpression;
}
pub trait PipelineSuccess<H: HostTypes> {
fn grounding_reached(&self) -> bool;
fn final_grounding(&self) -> &H::HostString;
}
pub trait PipelineFailureReason<H: HostTypes> {
fn failure_kind(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn failure_stage(&self) -> &Self::TermExpression;
}
pub trait PreflightCheck<H: HostTypes> {
fn preflight_kind(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn preflight_result(&self) -> &Self::TermExpression;
fn preflight_order(&self) -> u64;
}
pub trait FeasibilityResult<H: HostTypes> {
fn feasibility_kind(&self) -> &H::HostString;
fn feasibility_witness(&self) -> &H::HostString;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn infeasibility_kind(&self) -> &Self::TermExpression;
}
pub trait LeaseState<H: HostTypes> {
fn lease_phase(&self) -> &H::HostString;
}
pub trait ManagedLease<H: HostTypes> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn managed_lease_id(&self) -> &Self::TermExpression;
type LeaseState: LeaseState<H>;
fn lease_lifecycle(&self) -> &Self::LeaseState;
fn expiry_epoch(&self) -> u64;
fn lease_budget(&self) -> u64;
}
pub trait LeaseCheckpoint<H: HostTypes> {
fn checkpoint_epoch(&self) -> u64;
type ReductionState: ReductionState<H>;
fn checkpoint_state(&self) -> &Self::ReductionState;
fn lease_remaining_budget(&self) -> u64;
}
pub trait BackPressureSignal<H: HostTypes> {
fn pressure_level(&self) -> &H::HostString;
fn pressure_threshold(&self) -> H::Decimal;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn source_stage(&self) -> &Self::TermExpression;
fn target_stage(&self) -> &Self::TermExpression;
}
pub trait DeferredQuerySet<H: HostTypes> {
fn deferred_count(&self) -> u64;
fn deferral_epoch(&self) -> u64;
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn deferral_reason(&self) -> &Self::TermExpression;
}
pub trait SubleaseTransfer<H: HostTypes> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn source_lease_ref(&self) -> &Self::TermExpression;
fn target_lease_ref(&self) -> &Self::TermExpression;
fn transferred_budget(&self) -> u64;
fn transfer_completed(&self) -> bool;
}
pub trait ComparisonPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn comparison_field(&self) -> &Self::TermExpression;
fn comparison_operator(&self) -> &Self::TermExpression;
fn comparison_value(&self) -> &Self::TermExpression;
}
pub trait ConjunctionPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn conjuncts(&self) -> &[Self::TermExpression];
}
pub trait DisjunctionPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn disjuncts(&self) -> &[Self::TermExpression];
}
pub trait NegationPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn negated_predicate(&self) -> &Self::TermExpression;
}
pub trait MembershipPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn membership_set(&self) -> &Self::TermExpression;
fn membership_element(&self) -> &Self::TermExpression;
}
pub trait GroundingPredicate<H: HostTypes>: PredicateExpression<H> {
fn grounding_threshold(&self) -> u64;
}
pub trait SiteCoveragePredicate<H: HostTypes>: PredicateExpression<H> {
fn coverage_target(&self) -> u64;
}
pub trait EqualsPredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn equality_left(&self) -> &Self::TermExpression;
fn equality_right(&self) -> &Self::TermExpression;
}
pub trait NonNullPredicate<H: HostTypes>: PredicateExpression<H> {
fn non_null_field(&self) -> u64;
}
pub trait QuerySubtypePredicate<H: HostTypes>: PredicateExpression<H> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn query_type_ref(&self) -> &Self::TermExpression;
}
pub trait CompileUnit<H: HostTypes> {
type TermExpression: crate::kernel::schema::TermExpression<H>;
fn root_term(&self) -> &Self::TermExpression;
fn unit_witt_level(&self) -> WittLevel;
fn thermodynamic_budget(&self) -> &H::HostString;
fn target_domains(&self) -> &[VerificationDomain];
type Element: crate::kernel::address::Element<H>;
fn unit_address(&self) -> &Self::Element;
}
pub trait FailureField<H: HostTypes> {
fn of_failure(&self) -> &H::HostString;
fn field_name(&self) -> &H::HostString;
fn field_type(&self) -> &H::HostString;
}
pub trait SatBound<H: HostTypes> {
fn max_var_count(&self) -> u64;
fn max_clause_count(&self) -> u64;
fn max_literals_per_clause(&self) -> u64;
}
pub trait TimingBound<H: HostTypes> {
fn preflight_budget_ns(&self) -> u64;
fn runtime_budget_ns(&self) -> u64;
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullEulerReduction<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullEulerReduction<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullEulerReduction<H> {
pub const ABSENT: NullEulerReduction<H> = NullEulerReduction {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> EulerReduction<H> for NullEulerReduction<H> {
fn phase_parameter(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn stage_count(&self) -> u64 {
0
}
fn convergence_angle(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn composed_of_maps(&self) -> &[Self::TermExpression] {
&[]
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullPhaseRotationScheduler<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullPhaseRotationScheduler<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullPhaseRotationScheduler<H> {
pub const ABSENT: NullPhaseRotationScheduler<H> = NullPhaseRotationScheduler {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PhaseRotationScheduler<H> for NullPhaseRotationScheduler<H> {
fn rotation_schedule(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn base_angle(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullTargetConvergenceAngle<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullTargetConvergenceAngle<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullTargetConvergenceAngle<H> {
pub const ABSENT: NullTargetConvergenceAngle<H> = NullTargetConvergenceAngle {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> TargetConvergenceAngle<H> for NullTargetConvergenceAngle<H> {
fn target_angle(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullPhaseGateAttestation<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullPhaseGateAttestation<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullPhaseGateAttestation<H> {
pub const ABSENT: NullPhaseGateAttestation<H> = NullPhaseGateAttestation {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PhaseGateAttestation<H> for NullPhaseGateAttestation<H> {
type ReductionStep = NullReductionStep<H>;
fn gate_stage(&self) -> &Self::ReductionStep {
&<NullReductionStep<H>>::ABSENT
}
fn gate_expected_phase(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn gate_result(&self) -> bool {
false
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullComplexConjugateRollback<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullComplexConjugateRollback<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullComplexConjugateRollback<H> {
pub const ABSENT: NullComplexConjugateRollback<H> = NullComplexConjugateRollback {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ComplexConjugateRollback<H> for NullComplexConjugateRollback<H> {
type ReductionStep = NullReductionStep<H>;
fn rollback_target(&self) -> &Self::ReductionStep {
&<NullReductionStep<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullReductionStep<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullReductionStep<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullReductionStep<H> {
pub const ABSENT: NullReductionStep<H> = NullReductionStep {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ReductionStep<H> for NullReductionStep<H> {
fn stage_index(&self) -> u64 {
0
}
fn stage_name(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn expected_phase(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type StatePredicate = crate::kernel::predicate::NullStatePredicate<H>;
fn entry_guard(&self) -> &Self::StatePredicate {
&<crate::kernel::predicate::NullStatePredicate<H>>::ABSENT
}
fn exit_guard(&self) -> &Self::StatePredicate {
&<crate::kernel::predicate::NullStatePredicate<H>>::ABSENT
}
type Effect = crate::kernel::effect::NullEffect<H>;
fn stage_effect(&self) -> &Self::Effect {
&<crate::kernel::effect::NullEffect<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullReductionState<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullReductionState<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullReductionState<H> {
pub const ABSENT: NullReductionState<H> = NullReductionState {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ReductionState<H> for NullReductionState<H> {
type ReductionStep = NullReductionStep<H>;
fn current_stage(&self) -> &Self::ReductionStep {
&<NullReductionStep<H>>::ABSENT
}
fn phase_angle(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn pinned_mask(&self) -> u64 {
0
}
fn free_rank(&self) -> u64 {
0
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn site_state(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullReductionRule<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullReductionRule<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullReductionRule<H> {
pub const ABSENT: NullReductionRule<H> = NullReductionRule {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ReductionRule<H> for NullReductionRule<H> {
type GuardedTransition = crate::kernel::predicate::NullGuardedTransition<H>;
fn transition_guard(&self) -> &Self::GuardedTransition {
&<crate::kernel::predicate::NullGuardedTransition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn transition_effect(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn transition_advance(&self) -> bool {
false
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullEpoch<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullEpoch<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullEpoch<H> {
pub const ABSENT: NullEpoch<H> = NullEpoch {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Epoch<H> for NullEpoch<H> {
fn epoch_index(&self) -> u64 {
0
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn epoch_datum(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullEpochBoundary<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullEpochBoundary<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullEpochBoundary<H> {
pub const ABSENT: NullEpochBoundary<H> = NullEpochBoundary {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> EpochBoundary<H> for NullEpochBoundary<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn epoch_boundary_type(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn preserved_grounding(&self) -> bool {
false
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullPredicateExpression<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullPredicateExpression<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullPredicateExpression<H> {
pub const ABSENT: NullPredicateExpression<H> = NullPredicateExpression {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullPredicateExpression<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullGuardExpression<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullGuardExpression<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullGuardExpression<H> {
pub const ABSENT: NullGuardExpression<H> = NullGuardExpression {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> GuardExpression<H> for NullGuardExpression<H> {
type PredicateExpression = NullPredicateExpression<H>;
fn guard_predicates(&self) -> &[Self::PredicateExpression] {
&[]
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullTransitionEffect<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullTransitionEffect<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullTransitionEffect<H> {
pub const ABSENT: NullTransitionEffect<H> = NullTransitionEffect {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> TransitionEffect<H> for NullTransitionEffect<H> {
type PropertyBind = NullPropertyBind<H>;
fn effect_bindings(&self) -> &[Self::PropertyBind] {
&[]
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullPropertyBind<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullPropertyBind<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullPropertyBind<H> {
pub const ABSENT: NullPropertyBind<H> = NullPropertyBind {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PropertyBind<H> for NullPropertyBind<H> {
fn bind_target(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn bind_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullReductionAdvance<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullReductionAdvance<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullReductionAdvance<H> {
pub const ABSENT: NullReductionAdvance<H> = NullReductionAdvance {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ReductionAdvance<H> for NullReductionAdvance<H> {
type ReductionStep = NullReductionStep<H>;
fn advance_from(&self) -> &Self::ReductionStep {
&<NullReductionStep<H>>::ABSENT
}
fn advance_to(&self) -> &Self::ReductionStep {
&<NullReductionStep<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullServiceWindow<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullServiceWindow<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullServiceWindow<H> {
pub const ABSENT: NullServiceWindow<H> = NullServiceWindow {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ServiceWindow<H> for NullServiceWindow<H> {
fn window_size(&self) -> u64 {
0
}
fn window_offset(&self) -> u64 {
0
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn base_context_ref(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullReductionTransaction<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullReductionTransaction<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullReductionTransaction<H> {
pub const ABSENT: NullReductionTransaction<H> = NullReductionTransaction {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ReductionTransaction<H> for NullReductionTransaction<H> {
fn transaction_policy(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn transaction_outcome(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn transaction_scope(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn transaction_status(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullPipelineSuccess<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullPipelineSuccess<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullPipelineSuccess<H> {
pub const ABSENT: NullPipelineSuccess<H> = NullPipelineSuccess {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PipelineSuccess<H> for NullPipelineSuccess<H> {
fn grounding_reached(&self) -> bool {
false
}
fn final_grounding(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullPipelineFailureReason<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullPipelineFailureReason<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullPipelineFailureReason<H> {
pub const ABSENT: NullPipelineFailureReason<H> = NullPipelineFailureReason {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PipelineFailureReason<H> for NullPipelineFailureReason<H> {
fn failure_kind(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn failure_stage(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullPreflightCheck<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullPreflightCheck<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullPreflightCheck<H> {
pub const ABSENT: NullPreflightCheck<H> = NullPreflightCheck {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PreflightCheck<H> for NullPreflightCheck<H> {
fn preflight_kind(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn preflight_result(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn preflight_order(&self) -> u64 {
0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullFeasibilityResult<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullFeasibilityResult<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullFeasibilityResult<H> {
pub const ABSENT: NullFeasibilityResult<H> = NullFeasibilityResult {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> FeasibilityResult<H> for NullFeasibilityResult<H> {
fn feasibility_kind(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn feasibility_witness(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn infeasibility_kind(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullLeaseState<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullLeaseState<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullLeaseState<H> {
pub const ABSENT: NullLeaseState<H> = NullLeaseState {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> LeaseState<H> for NullLeaseState<H> {
fn lease_phase(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullManagedLease<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullManagedLease<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullManagedLease<H> {
pub const ABSENT: NullManagedLease<H> = NullManagedLease {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ManagedLease<H> for NullManagedLease<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn managed_lease_id(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type LeaseState = NullLeaseState<H>;
fn lease_lifecycle(&self) -> &Self::LeaseState {
&<NullLeaseState<H>>::ABSENT
}
fn expiry_epoch(&self) -> u64 {
0
}
fn lease_budget(&self) -> u64 {
0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullLeaseCheckpoint<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullLeaseCheckpoint<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullLeaseCheckpoint<H> {
pub const ABSENT: NullLeaseCheckpoint<H> = NullLeaseCheckpoint {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> LeaseCheckpoint<H> for NullLeaseCheckpoint<H> {
fn checkpoint_epoch(&self) -> u64 {
0
}
type ReductionState = NullReductionState<H>;
fn checkpoint_state(&self) -> &Self::ReductionState {
&<NullReductionState<H>>::ABSENT
}
fn lease_remaining_budget(&self) -> u64 {
0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullBackPressureSignal<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullBackPressureSignal<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullBackPressureSignal<H> {
pub const ABSENT: NullBackPressureSignal<H> = NullBackPressureSignal {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> BackPressureSignal<H> for NullBackPressureSignal<H> {
fn pressure_level(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn pressure_threshold(&self) -> H::Decimal {
H::EMPTY_DECIMAL
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn source_stage(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn target_stage(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullDeferredQuerySet<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullDeferredQuerySet<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullDeferredQuerySet<H> {
pub const ABSENT: NullDeferredQuerySet<H> = NullDeferredQuerySet {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> DeferredQuerySet<H> for NullDeferredQuerySet<H> {
fn deferred_count(&self) -> u64 {
0
}
fn deferral_epoch(&self) -> u64 {
0
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn deferral_reason(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullSubleaseTransfer<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullSubleaseTransfer<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullSubleaseTransfer<H> {
pub const ABSENT: NullSubleaseTransfer<H> = NullSubleaseTransfer {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> SubleaseTransfer<H> for NullSubleaseTransfer<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn source_lease_ref(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn target_lease_ref(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn transferred_budget(&self) -> u64 {
0
}
fn transfer_completed(&self) -> bool {
false
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullComparisonPredicate<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullComparisonPredicate<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullComparisonPredicate<H> {
pub const ABSENT: NullComparisonPredicate<H> = NullComparisonPredicate {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullComparisonPredicate<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<H: HostTypes> ComparisonPredicate<H> for NullComparisonPredicate<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn comparison_field(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn comparison_operator(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn comparison_value(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullConjunctionPredicate<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullConjunctionPredicate<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullConjunctionPredicate<H> {
pub const ABSENT: NullConjunctionPredicate<H> = NullConjunctionPredicate {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullConjunctionPredicate<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<H: HostTypes> ConjunctionPredicate<H> for NullConjunctionPredicate<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn conjuncts(&self) -> &[Self::TermExpression] {
&[]
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullDisjunctionPredicate<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullDisjunctionPredicate<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullDisjunctionPredicate<H> {
pub const ABSENT: NullDisjunctionPredicate<H> = NullDisjunctionPredicate {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullDisjunctionPredicate<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<H: HostTypes> DisjunctionPredicate<H> for NullDisjunctionPredicate<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn disjuncts(&self) -> &[Self::TermExpression] {
&[]
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullNegationPredicate<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullNegationPredicate<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullNegationPredicate<H> {
pub const ABSENT: NullNegationPredicate<H> = NullNegationPredicate {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullNegationPredicate<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<H: HostTypes> NegationPredicate<H> for NullNegationPredicate<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn negated_predicate(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullMembershipPredicate<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullMembershipPredicate<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullMembershipPredicate<H> {
pub const ABSENT: NullMembershipPredicate<H> = NullMembershipPredicate {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullMembershipPredicate<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<H: HostTypes> MembershipPredicate<H> for NullMembershipPredicate<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn membership_set(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn membership_element(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullGroundingPredicate<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullGroundingPredicate<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullGroundingPredicate<H> {
pub const ABSENT: NullGroundingPredicate<H> = NullGroundingPredicate {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullGroundingPredicate<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<H: HostTypes> GroundingPredicate<H> for NullGroundingPredicate<H> {
fn grounding_threshold(&self) -> u64 {
0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullSiteCoveragePredicate<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullSiteCoveragePredicate<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullSiteCoveragePredicate<H> {
pub const ABSENT: NullSiteCoveragePredicate<H> = NullSiteCoveragePredicate {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullSiteCoveragePredicate<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<H: HostTypes> SiteCoveragePredicate<H> for NullSiteCoveragePredicate<H> {
fn coverage_target(&self) -> u64 {
0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullEqualsPredicate<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullEqualsPredicate<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullEqualsPredicate<H> {
pub const ABSENT: NullEqualsPredicate<H> = NullEqualsPredicate {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullEqualsPredicate<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<H: HostTypes> EqualsPredicate<H> for NullEqualsPredicate<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn equality_left(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn equality_right(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullNonNullPredicate<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullNonNullPredicate<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullNonNullPredicate<H> {
pub const ABSENT: NullNonNullPredicate<H> = NullNonNullPredicate {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullNonNullPredicate<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<H: HostTypes> NonNullPredicate<H> for NullNonNullPredicate<H> {
fn non_null_field(&self) -> u64 {
0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullQuerySubtypePredicate<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullQuerySubtypePredicate<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullQuerySubtypePredicate<H> {
pub const ABSENT: NullQuerySubtypePredicate<H> = NullQuerySubtypePredicate {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> PredicateExpression<H> for NullQuerySubtypePredicate<H> {
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<H: HostTypes> QuerySubtypePredicate<H> for NullQuerySubtypePredicate<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn query_type_ref(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullCompileUnit<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullCompileUnit<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullCompileUnit<H> {
pub const ABSENT: NullCompileUnit<H> = NullCompileUnit {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> CompileUnit<H> for NullCompileUnit<H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn root_term(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn unit_witt_level(&self) -> WittLevel {
<WittLevel>::default()
}
fn thermodynamic_budget(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn target_domains(&self) -> &[VerificationDomain] {
&[]
}
type Element = crate::kernel::address::NullElement<H>;
fn unit_address(&self) -> &Self::Element {
&<crate::kernel::address::NullElement<H>>::ABSENT
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullFailureField<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullFailureField<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullFailureField<H> {
pub const ABSENT: NullFailureField<H> = NullFailureField {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> FailureField<H> for NullFailureField<H> {
fn of_failure(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn field_name(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn field_type(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullSatBound<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullSatBound<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullSatBound<H> {
pub const ABSENT: NullSatBound<H> = NullSatBound {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> SatBound<H> for NullSatBound<H> {
fn max_var_count(&self) -> u64 {
0
}
fn max_clause_count(&self) -> u64 {
0
}
fn max_literals_per_clause(&self) -> u64 {
0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullTimingBound<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullTimingBound<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullTimingBound<H> {
pub const ABSENT: NullTimingBound<H> = NullTimingBound {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> TimingBound<H> for NullTimingBound<H> {
fn preflight_budget_ns(&self) -> u64 {
0
}
fn runtime_budget_ns(&self) -> u64 {
0
}
}
#[derive(Debug)]
pub struct EulerReductionHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for EulerReductionHandle<H> {}
impl<H: HostTypes> Clone for EulerReductionHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for EulerReductionHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for EulerReductionHandle<H> {}
impl<H: HostTypes> core::hash::Hash for EulerReductionHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> EulerReductionHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait EulerReductionResolver<H: HostTypes> {
fn resolve(&self, handle: EulerReductionHandle<H>) -> Option<EulerReductionRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct EulerReductionRecord<H: HostTypes> {
pub phase_parameter: &'static H::HostString,
pub stage_count: u64,
pub convergence_angle: &'static H::HostString,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedEulerReduction<'r, R: EulerReductionResolver<H>, H: HostTypes> {
handle: EulerReductionHandle<H>,
resolver: &'r R,
record: Option<EulerReductionRecord<H>>,
}
impl<'r, R: EulerReductionResolver<H>, H: HostTypes> ResolvedEulerReduction<'r, R, H> {
#[inline]
pub fn new(handle: EulerReductionHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> EulerReductionHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&EulerReductionRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: EulerReductionResolver<H>, H: HostTypes> EulerReduction<H>
for ResolvedEulerReduction<'r, R, H>
{
fn phase_parameter(&self) -> &H::HostString {
match &self.record {
Some(r) => r.phase_parameter,
None => H::EMPTY_HOST_STRING,
}
}
fn stage_count(&self) -> u64 {
match &self.record {
Some(r) => r.stage_count,
None => 0,
}
}
fn convergence_angle(&self) -> &H::HostString {
match &self.record {
Some(r) => r.convergence_angle,
None => H::EMPTY_HOST_STRING,
}
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn composed_of_maps(&self) -> &[Self::TermExpression] {
&[]
}
}
#[derive(Debug)]
pub struct PhaseRotationSchedulerHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for PhaseRotationSchedulerHandle<H> {}
impl<H: HostTypes> Clone for PhaseRotationSchedulerHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for PhaseRotationSchedulerHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for PhaseRotationSchedulerHandle<H> {}
impl<H: HostTypes> core::hash::Hash for PhaseRotationSchedulerHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> PhaseRotationSchedulerHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait PhaseRotationSchedulerResolver<H: HostTypes> {
fn resolve(
&self,
handle: PhaseRotationSchedulerHandle<H>,
) -> Option<PhaseRotationSchedulerRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct PhaseRotationSchedulerRecord<H: HostTypes> {
pub rotation_schedule: &'static H::HostString,
pub base_angle: &'static H::HostString,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedPhaseRotationScheduler<'r, R: PhaseRotationSchedulerResolver<H>, H: HostTypes> {
handle: PhaseRotationSchedulerHandle<H>,
resolver: &'r R,
record: Option<PhaseRotationSchedulerRecord<H>>,
}
impl<'r, R: PhaseRotationSchedulerResolver<H>, H: HostTypes>
ResolvedPhaseRotationScheduler<'r, R, H>
{
#[inline]
pub fn new(handle: PhaseRotationSchedulerHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> PhaseRotationSchedulerHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&PhaseRotationSchedulerRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: PhaseRotationSchedulerResolver<H>, H: HostTypes> PhaseRotationScheduler<H>
for ResolvedPhaseRotationScheduler<'r, R, H>
{
fn rotation_schedule(&self) -> &H::HostString {
match &self.record {
Some(r) => r.rotation_schedule,
None => H::EMPTY_HOST_STRING,
}
}
fn base_angle(&self) -> &H::HostString {
match &self.record {
Some(r) => r.base_angle,
None => H::EMPTY_HOST_STRING,
}
}
}
#[derive(Debug)]
pub struct TargetConvergenceAngleHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for TargetConvergenceAngleHandle<H> {}
impl<H: HostTypes> Clone for TargetConvergenceAngleHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for TargetConvergenceAngleHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for TargetConvergenceAngleHandle<H> {}
impl<H: HostTypes> core::hash::Hash for TargetConvergenceAngleHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> TargetConvergenceAngleHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait TargetConvergenceAngleResolver<H: HostTypes> {
fn resolve(
&self,
handle: TargetConvergenceAngleHandle<H>,
) -> Option<TargetConvergenceAngleRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct TargetConvergenceAngleRecord<H: HostTypes> {
pub target_angle: &'static H::HostString,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedTargetConvergenceAngle<'r, R: TargetConvergenceAngleResolver<H>, H: HostTypes> {
handle: TargetConvergenceAngleHandle<H>,
resolver: &'r R,
record: Option<TargetConvergenceAngleRecord<H>>,
}
impl<'r, R: TargetConvergenceAngleResolver<H>, H: HostTypes>
ResolvedTargetConvergenceAngle<'r, R, H>
{
#[inline]
pub fn new(handle: TargetConvergenceAngleHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> TargetConvergenceAngleHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&TargetConvergenceAngleRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: TargetConvergenceAngleResolver<H>, H: HostTypes> TargetConvergenceAngle<H>
for ResolvedTargetConvergenceAngle<'r, R, H>
{
fn target_angle(&self) -> &H::HostString {
match &self.record {
Some(r) => r.target_angle,
None => H::EMPTY_HOST_STRING,
}
}
}
#[derive(Debug)]
pub struct PhaseGateAttestationHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for PhaseGateAttestationHandle<H> {}
impl<H: HostTypes> Clone for PhaseGateAttestationHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for PhaseGateAttestationHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for PhaseGateAttestationHandle<H> {}
impl<H: HostTypes> core::hash::Hash for PhaseGateAttestationHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> PhaseGateAttestationHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait PhaseGateAttestationResolver<H: HostTypes> {
fn resolve(
&self,
handle: PhaseGateAttestationHandle<H>,
) -> Option<PhaseGateAttestationRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct PhaseGateAttestationRecord<H: HostTypes> {
pub gate_stage_handle: ReductionStepHandle<H>,
pub gate_expected_phase: &'static H::HostString,
pub gate_result: bool,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedPhaseGateAttestation<'r, R: PhaseGateAttestationResolver<H>, H: HostTypes> {
handle: PhaseGateAttestationHandle<H>,
resolver: &'r R,
record: Option<PhaseGateAttestationRecord<H>>,
}
impl<'r, R: PhaseGateAttestationResolver<H>, H: HostTypes> ResolvedPhaseGateAttestation<'r, R, H> {
#[inline]
pub fn new(handle: PhaseGateAttestationHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> PhaseGateAttestationHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&PhaseGateAttestationRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: PhaseGateAttestationResolver<H>, H: HostTypes> PhaseGateAttestation<H>
for ResolvedPhaseGateAttestation<'r, R, H>
{
type ReductionStep = NullReductionStep<H>;
fn gate_stage(&self) -> &Self::ReductionStep {
&<NullReductionStep<H>>::ABSENT
}
fn gate_expected_phase(&self) -> &H::HostString {
match &self.record {
Some(r) => r.gate_expected_phase,
None => H::EMPTY_HOST_STRING,
}
}
fn gate_result(&self) -> bool {
match &self.record {
Some(r) => r.gate_result,
None => false,
}
}
}
impl<'r, R: PhaseGateAttestationResolver<H>, H: HostTypes> ResolvedPhaseGateAttestation<'r, R, H> {
#[inline]
pub fn resolve_gate_stage<'r2, R2: ReductionStepResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedReductionStep<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedReductionStep::new(record.gate_stage_handle, r))
}
}
#[derive(Debug)]
pub struct ComplexConjugateRollbackHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ComplexConjugateRollbackHandle<H> {}
impl<H: HostTypes> Clone for ComplexConjugateRollbackHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ComplexConjugateRollbackHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ComplexConjugateRollbackHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ComplexConjugateRollbackHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ComplexConjugateRollbackHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait ComplexConjugateRollbackResolver<H: HostTypes> {
fn resolve(
&self,
handle: ComplexConjugateRollbackHandle<H>,
) -> Option<ComplexConjugateRollbackRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ComplexConjugateRollbackRecord<H: HostTypes> {
pub rollback_target_handle: ReductionStepHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedComplexConjugateRollback<
'r,
R: ComplexConjugateRollbackResolver<H>,
H: HostTypes,
> {
handle: ComplexConjugateRollbackHandle<H>,
resolver: &'r R,
record: Option<ComplexConjugateRollbackRecord<H>>,
}
impl<'r, R: ComplexConjugateRollbackResolver<H>, H: HostTypes>
ResolvedComplexConjugateRollback<'r, R, H>
{
#[inline]
pub fn new(handle: ComplexConjugateRollbackHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> ComplexConjugateRollbackHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ComplexConjugateRollbackRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ComplexConjugateRollbackResolver<H>, H: HostTypes> ComplexConjugateRollback<H>
for ResolvedComplexConjugateRollback<'r, R, H>
{
type ReductionStep = NullReductionStep<H>;
fn rollback_target(&self) -> &Self::ReductionStep {
&<NullReductionStep<H>>::ABSENT
}
}
impl<'r, R: ComplexConjugateRollbackResolver<H>, H: HostTypes>
ResolvedComplexConjugateRollback<'r, R, H>
{
#[inline]
pub fn resolve_rollback_target<'r2, R2: ReductionStepResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedReductionStep<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedReductionStep::new(record.rollback_target_handle, r))
}
}
#[derive(Debug)]
pub struct ReductionStepHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ReductionStepHandle<H> {}
impl<H: HostTypes> Clone for ReductionStepHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ReductionStepHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ReductionStepHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ReductionStepHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ReductionStepHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait ReductionStepResolver<H: HostTypes> {
fn resolve(&self, handle: ReductionStepHandle<H>) -> Option<ReductionStepRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ReductionStepRecord<H: HostTypes> {
pub stage_index: u64,
pub stage_name: &'static H::HostString,
pub expected_phase: &'static H::HostString,
pub entry_guard_handle: crate::kernel::predicate::StatePredicateHandle<H>,
pub exit_guard_handle: crate::kernel::predicate::StatePredicateHandle<H>,
pub stage_effect_handle: crate::kernel::effect::EffectHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedReductionStep<'r, R: ReductionStepResolver<H>, H: HostTypes> {
handle: ReductionStepHandle<H>,
resolver: &'r R,
record: Option<ReductionStepRecord<H>>,
}
impl<'r, R: ReductionStepResolver<H>, H: HostTypes> ResolvedReductionStep<'r, R, H> {
#[inline]
pub fn new(handle: ReductionStepHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> ReductionStepHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ReductionStepRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ReductionStepResolver<H>, H: HostTypes> ReductionStep<H>
for ResolvedReductionStep<'r, R, H>
{
fn stage_index(&self) -> u64 {
match &self.record {
Some(r) => r.stage_index,
None => 0,
}
}
fn stage_name(&self) -> &H::HostString {
match &self.record {
Some(r) => r.stage_name,
None => H::EMPTY_HOST_STRING,
}
}
fn expected_phase(&self) -> &H::HostString {
match &self.record {
Some(r) => r.expected_phase,
None => H::EMPTY_HOST_STRING,
}
}
type StatePredicate = crate::kernel::predicate::NullStatePredicate<H>;
fn entry_guard(&self) -> &Self::StatePredicate {
&<crate::kernel::predicate::NullStatePredicate<H>>::ABSENT
}
fn exit_guard(&self) -> &Self::StatePredicate {
&<crate::kernel::predicate::NullStatePredicate<H>>::ABSENT
}
type Effect = crate::kernel::effect::NullEffect<H>;
fn stage_effect(&self) -> &Self::Effect {
&<crate::kernel::effect::NullEffect<H>>::ABSENT
}
}
impl<'r, R: ReductionStepResolver<H>, H: HostTypes> ResolvedReductionStep<'r, R, H> {
#[inline]
pub fn resolve_entry_guard<'r2, R2: crate::kernel::predicate::StatePredicateResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::predicate::ResolvedStatePredicate<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::predicate::ResolvedStatePredicate::new(
record.entry_guard_handle,
r,
))
}
#[inline]
pub fn resolve_exit_guard<'r2, R2: crate::kernel::predicate::StatePredicateResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::predicate::ResolvedStatePredicate<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::predicate::ResolvedStatePredicate::new(
record.exit_guard_handle,
r,
))
}
#[inline]
pub fn resolve_stage_effect<'r2, R2: crate::kernel::effect::EffectResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::effect::ResolvedEffect<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::effect::ResolvedEffect::new(
record.stage_effect_handle,
r,
))
}
}
#[derive(Debug)]
pub struct ReductionStateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ReductionStateHandle<H> {}
impl<H: HostTypes> Clone for ReductionStateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ReductionStateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ReductionStateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ReductionStateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ReductionStateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait ReductionStateResolver<H: HostTypes> {
fn resolve(&self, handle: ReductionStateHandle<H>) -> Option<ReductionStateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ReductionStateRecord<H: HostTypes> {
pub current_stage_handle: ReductionStepHandle<H>,
pub phase_angle: &'static H::HostString,
pub pinned_mask: u64,
pub free_rank: u64,
pub site_state_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedReductionState<'r, R: ReductionStateResolver<H>, H: HostTypes> {
handle: ReductionStateHandle<H>,
resolver: &'r R,
record: Option<ReductionStateRecord<H>>,
}
impl<'r, R: ReductionStateResolver<H>, H: HostTypes> ResolvedReductionState<'r, R, H> {
#[inline]
pub fn new(handle: ReductionStateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> ReductionStateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ReductionStateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ReductionStateResolver<H>, H: HostTypes> ReductionState<H>
for ResolvedReductionState<'r, R, H>
{
type ReductionStep = NullReductionStep<H>;
fn current_stage(&self) -> &Self::ReductionStep {
&<NullReductionStep<H>>::ABSENT
}
fn phase_angle(&self) -> &H::HostString {
match &self.record {
Some(r) => r.phase_angle,
None => H::EMPTY_HOST_STRING,
}
}
fn pinned_mask(&self) -> u64 {
match &self.record {
Some(r) => r.pinned_mask,
None => 0,
}
}
fn free_rank(&self) -> u64 {
match &self.record {
Some(r) => r.free_rank,
None => 0,
}
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn site_state(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: ReductionStateResolver<H>, H: HostTypes> ResolvedReductionState<'r, R, H> {
#[inline]
pub fn resolve_current_stage<'r2, R2: ReductionStepResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedReductionStep<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedReductionStep::new(record.current_stage_handle, r))
}
#[inline]
pub fn resolve_site_state<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.site_state_handle,
r,
))
}
}
#[derive(Debug)]
pub struct ReductionRuleHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ReductionRuleHandle<H> {}
impl<H: HostTypes> Clone for ReductionRuleHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ReductionRuleHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ReductionRuleHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ReductionRuleHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ReductionRuleHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait ReductionRuleResolver<H: HostTypes> {
fn resolve(&self, handle: ReductionRuleHandle<H>) -> Option<ReductionRuleRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ReductionRuleRecord<H: HostTypes> {
pub transition_guard_handle: crate::kernel::predicate::GuardedTransitionHandle<H>,
pub transition_effect_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub transition_advance: bool,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedReductionRule<'r, R: ReductionRuleResolver<H>, H: HostTypes> {
handle: ReductionRuleHandle<H>,
resolver: &'r R,
record: Option<ReductionRuleRecord<H>>,
}
impl<'r, R: ReductionRuleResolver<H>, H: HostTypes> ResolvedReductionRule<'r, R, H> {
#[inline]
pub fn new(handle: ReductionRuleHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> ReductionRuleHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ReductionRuleRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ReductionRuleResolver<H>, H: HostTypes> ReductionRule<H>
for ResolvedReductionRule<'r, R, H>
{
type GuardedTransition = crate::kernel::predicate::NullGuardedTransition<H>;
fn transition_guard(&self) -> &Self::GuardedTransition {
&<crate::kernel::predicate::NullGuardedTransition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn transition_effect(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn transition_advance(&self) -> bool {
match &self.record {
Some(r) => r.transition_advance,
None => false,
}
}
}
impl<'r, R: ReductionRuleResolver<H>, H: HostTypes> ResolvedReductionRule<'r, R, H> {
#[inline]
pub fn resolve_transition_guard<
'r2,
R2: crate::kernel::predicate::GuardedTransitionResolver<H>,
>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::predicate::ResolvedGuardedTransition<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::predicate::ResolvedGuardedTransition::new(
record.transition_guard_handle,
r,
))
}
#[inline]
pub fn resolve_transition_effect<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.transition_effect_handle,
r,
))
}
}
#[derive(Debug)]
pub struct EpochHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for EpochHandle<H> {}
impl<H: HostTypes> Clone for EpochHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for EpochHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for EpochHandle<H> {}
impl<H: HostTypes> core::hash::Hash for EpochHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> EpochHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait EpochResolver<H: HostTypes> {
fn resolve(&self, handle: EpochHandle<H>) -> Option<EpochRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct EpochRecord<H: HostTypes> {
pub epoch_index: u64,
pub epoch_datum_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedEpoch<'r, R: EpochResolver<H>, H: HostTypes> {
handle: EpochHandle<H>,
resolver: &'r R,
record: Option<EpochRecord<H>>,
}
impl<'r, R: EpochResolver<H>, H: HostTypes> ResolvedEpoch<'r, R, H> {
#[inline]
pub fn new(handle: EpochHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> EpochHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&EpochRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: EpochResolver<H>, H: HostTypes> Epoch<H> for ResolvedEpoch<'r, R, H> {
fn epoch_index(&self) -> u64 {
match &self.record {
Some(r) => r.epoch_index,
None => 0,
}
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn epoch_datum(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: EpochResolver<H>, H: HostTypes> ResolvedEpoch<'r, R, H> {
#[inline]
pub fn resolve_epoch_datum<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.epoch_datum_handle,
r,
))
}
}
#[derive(Debug)]
pub struct EpochBoundaryHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for EpochBoundaryHandle<H> {}
impl<H: HostTypes> Clone for EpochBoundaryHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for EpochBoundaryHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for EpochBoundaryHandle<H> {}
impl<H: HostTypes> core::hash::Hash for EpochBoundaryHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> EpochBoundaryHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait EpochBoundaryResolver<H: HostTypes> {
fn resolve(&self, handle: EpochBoundaryHandle<H>) -> Option<EpochBoundaryRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct EpochBoundaryRecord<H: HostTypes> {
pub epoch_boundary_type_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub preserved_grounding: bool,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedEpochBoundary<'r, R: EpochBoundaryResolver<H>, H: HostTypes> {
handle: EpochBoundaryHandle<H>,
resolver: &'r R,
record: Option<EpochBoundaryRecord<H>>,
}
impl<'r, R: EpochBoundaryResolver<H>, H: HostTypes> ResolvedEpochBoundary<'r, R, H> {
#[inline]
pub fn new(handle: EpochBoundaryHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> EpochBoundaryHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&EpochBoundaryRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: EpochBoundaryResolver<H>, H: HostTypes> EpochBoundary<H>
for ResolvedEpochBoundary<'r, R, H>
{
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn epoch_boundary_type(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn preserved_grounding(&self) -> bool {
match &self.record {
Some(r) => r.preserved_grounding,
None => false,
}
}
}
impl<'r, R: EpochBoundaryResolver<H>, H: HostTypes> ResolvedEpochBoundary<'r, R, H> {
#[inline]
pub fn resolve_epoch_boundary_type<
'r2,
R2: crate::kernel::schema::TermExpressionResolver<H>,
>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.epoch_boundary_type_handle,
r,
))
}
}
#[derive(Debug)]
pub struct PredicateExpressionHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for PredicateExpressionHandle<H> {}
impl<H: HostTypes> Clone for PredicateExpressionHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for PredicateExpressionHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for PredicateExpressionHandle<H> {}
impl<H: HostTypes> core::hash::Hash for PredicateExpressionHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> PredicateExpressionHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait PredicateExpressionResolver<H: HostTypes> {
fn resolve(&self, handle: PredicateExpressionHandle<H>)
-> Option<PredicateExpressionRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct PredicateExpressionRecord<H: HostTypes> {
pub predicate_field: &'static H::HostString,
pub predicate_operator: &'static H::HostString,
pub predicate_value: &'static H::HostString,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedPredicateExpression<'r, R: PredicateExpressionResolver<H>, H: HostTypes> {
handle: PredicateExpressionHandle<H>,
resolver: &'r R,
record: Option<PredicateExpressionRecord<H>>,
}
impl<'r, R: PredicateExpressionResolver<H>, H: HostTypes> ResolvedPredicateExpression<'r, R, H> {
#[inline]
pub fn new(handle: PredicateExpressionHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> PredicateExpressionHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&PredicateExpressionRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: PredicateExpressionResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedPredicateExpression<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
match &self.record {
Some(r) => r.predicate_field,
None => H::EMPTY_HOST_STRING,
}
}
fn predicate_operator(&self) -> &H::HostString {
match &self.record {
Some(r) => r.predicate_operator,
None => H::EMPTY_HOST_STRING,
}
}
fn predicate_value(&self) -> &H::HostString {
match &self.record {
Some(r) => r.predicate_value,
None => H::EMPTY_HOST_STRING,
}
}
}
#[derive(Debug)]
pub struct GuardExpressionHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for GuardExpressionHandle<H> {}
impl<H: HostTypes> Clone for GuardExpressionHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for GuardExpressionHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for GuardExpressionHandle<H> {}
impl<H: HostTypes> core::hash::Hash for GuardExpressionHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> GuardExpressionHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait GuardExpressionResolver<H: HostTypes> {
fn resolve(&self, handle: GuardExpressionHandle<H>) -> Option<GuardExpressionRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct GuardExpressionRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedGuardExpression<'r, R: GuardExpressionResolver<H>, H: HostTypes> {
handle: GuardExpressionHandle<H>,
resolver: &'r R,
record: Option<GuardExpressionRecord<H>>,
}
impl<'r, R: GuardExpressionResolver<H>, H: HostTypes> ResolvedGuardExpression<'r, R, H> {
#[inline]
pub fn new(handle: GuardExpressionHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> GuardExpressionHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&GuardExpressionRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: GuardExpressionResolver<H>, H: HostTypes> GuardExpression<H>
for ResolvedGuardExpression<'r, R, H>
{
type PredicateExpression = NullPredicateExpression<H>;
fn guard_predicates(&self) -> &[Self::PredicateExpression] {
&[]
}
}
#[derive(Debug)]
pub struct TransitionEffectHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for TransitionEffectHandle<H> {}
impl<H: HostTypes> Clone for TransitionEffectHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for TransitionEffectHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for TransitionEffectHandle<H> {}
impl<H: HostTypes> core::hash::Hash for TransitionEffectHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> TransitionEffectHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait TransitionEffectResolver<H: HostTypes> {
fn resolve(&self, handle: TransitionEffectHandle<H>) -> Option<TransitionEffectRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct TransitionEffectRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedTransitionEffect<'r, R: TransitionEffectResolver<H>, H: HostTypes> {
handle: TransitionEffectHandle<H>,
resolver: &'r R,
record: Option<TransitionEffectRecord<H>>,
}
impl<'r, R: TransitionEffectResolver<H>, H: HostTypes> ResolvedTransitionEffect<'r, R, H> {
#[inline]
pub fn new(handle: TransitionEffectHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> TransitionEffectHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&TransitionEffectRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: TransitionEffectResolver<H>, H: HostTypes> TransitionEffect<H>
for ResolvedTransitionEffect<'r, R, H>
{
type PropertyBind = NullPropertyBind<H>;
fn effect_bindings(&self) -> &[Self::PropertyBind] {
&[]
}
}
#[derive(Debug)]
pub struct PropertyBindHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for PropertyBindHandle<H> {}
impl<H: HostTypes> Clone for PropertyBindHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for PropertyBindHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for PropertyBindHandle<H> {}
impl<H: HostTypes> core::hash::Hash for PropertyBindHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> PropertyBindHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait PropertyBindResolver<H: HostTypes> {
fn resolve(&self, handle: PropertyBindHandle<H>) -> Option<PropertyBindRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct PropertyBindRecord<H: HostTypes> {
pub bind_target: &'static H::HostString,
pub bind_value: &'static H::HostString,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedPropertyBind<'r, R: PropertyBindResolver<H>, H: HostTypes> {
handle: PropertyBindHandle<H>,
resolver: &'r R,
record: Option<PropertyBindRecord<H>>,
}
impl<'r, R: PropertyBindResolver<H>, H: HostTypes> ResolvedPropertyBind<'r, R, H> {
#[inline]
pub fn new(handle: PropertyBindHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> PropertyBindHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&PropertyBindRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: PropertyBindResolver<H>, H: HostTypes> PropertyBind<H>
for ResolvedPropertyBind<'r, R, H>
{
fn bind_target(&self) -> &H::HostString {
match &self.record {
Some(r) => r.bind_target,
None => H::EMPTY_HOST_STRING,
}
}
fn bind_value(&self) -> &H::HostString {
match &self.record {
Some(r) => r.bind_value,
None => H::EMPTY_HOST_STRING,
}
}
}
#[derive(Debug)]
pub struct ReductionAdvanceHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ReductionAdvanceHandle<H> {}
impl<H: HostTypes> Clone for ReductionAdvanceHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ReductionAdvanceHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ReductionAdvanceHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ReductionAdvanceHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ReductionAdvanceHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait ReductionAdvanceResolver<H: HostTypes> {
fn resolve(&self, handle: ReductionAdvanceHandle<H>) -> Option<ReductionAdvanceRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ReductionAdvanceRecord<H: HostTypes> {
pub advance_from_handle: ReductionStepHandle<H>,
pub advance_to_handle: ReductionStepHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedReductionAdvance<'r, R: ReductionAdvanceResolver<H>, H: HostTypes> {
handle: ReductionAdvanceHandle<H>,
resolver: &'r R,
record: Option<ReductionAdvanceRecord<H>>,
}
impl<'r, R: ReductionAdvanceResolver<H>, H: HostTypes> ResolvedReductionAdvance<'r, R, H> {
#[inline]
pub fn new(handle: ReductionAdvanceHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> ReductionAdvanceHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ReductionAdvanceRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ReductionAdvanceResolver<H>, H: HostTypes> ReductionAdvance<H>
for ResolvedReductionAdvance<'r, R, H>
{
type ReductionStep = NullReductionStep<H>;
fn advance_from(&self) -> &Self::ReductionStep {
&<NullReductionStep<H>>::ABSENT
}
fn advance_to(&self) -> &Self::ReductionStep {
&<NullReductionStep<H>>::ABSENT
}
}
impl<'r, R: ReductionAdvanceResolver<H>, H: HostTypes> ResolvedReductionAdvance<'r, R, H> {
#[inline]
pub fn resolve_advance_from<'r2, R2: ReductionStepResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedReductionStep<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedReductionStep::new(record.advance_from_handle, r))
}
#[inline]
pub fn resolve_advance_to<'r2, R2: ReductionStepResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedReductionStep<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedReductionStep::new(record.advance_to_handle, r))
}
}
#[derive(Debug)]
pub struct ServiceWindowHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ServiceWindowHandle<H> {}
impl<H: HostTypes> Clone for ServiceWindowHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ServiceWindowHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ServiceWindowHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ServiceWindowHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ServiceWindowHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait ServiceWindowResolver<H: HostTypes> {
fn resolve(&self, handle: ServiceWindowHandle<H>) -> Option<ServiceWindowRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ServiceWindowRecord<H: HostTypes> {
pub window_size: u64,
pub window_offset: u64,
pub base_context_ref_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedServiceWindow<'r, R: ServiceWindowResolver<H>, H: HostTypes> {
handle: ServiceWindowHandle<H>,
resolver: &'r R,
record: Option<ServiceWindowRecord<H>>,
}
impl<'r, R: ServiceWindowResolver<H>, H: HostTypes> ResolvedServiceWindow<'r, R, H> {
#[inline]
pub fn new(handle: ServiceWindowHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> ServiceWindowHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ServiceWindowRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ServiceWindowResolver<H>, H: HostTypes> ServiceWindow<H>
for ResolvedServiceWindow<'r, R, H>
{
fn window_size(&self) -> u64 {
match &self.record {
Some(r) => r.window_size,
None => 0,
}
}
fn window_offset(&self) -> u64 {
match &self.record {
Some(r) => r.window_offset,
None => 0,
}
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn base_context_ref(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: ServiceWindowResolver<H>, H: HostTypes> ResolvedServiceWindow<'r, R, H> {
#[inline]
pub fn resolve_base_context_ref<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.base_context_ref_handle,
r,
))
}
}
#[derive(Debug)]
pub struct ReductionTransactionHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ReductionTransactionHandle<H> {}
impl<H: HostTypes> Clone for ReductionTransactionHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ReductionTransactionHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ReductionTransactionHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ReductionTransactionHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ReductionTransactionHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait ReductionTransactionResolver<H: HostTypes> {
fn resolve(
&self,
handle: ReductionTransactionHandle<H>,
) -> Option<ReductionTransactionRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ReductionTransactionRecord<H: HostTypes> {
pub transaction_policy: &'static H::HostString,
pub transaction_outcome_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub transaction_scope_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub transaction_status_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedReductionTransaction<'r, R: ReductionTransactionResolver<H>, H: HostTypes> {
handle: ReductionTransactionHandle<H>,
resolver: &'r R,
record: Option<ReductionTransactionRecord<H>>,
}
impl<'r, R: ReductionTransactionResolver<H>, H: HostTypes> ResolvedReductionTransaction<'r, R, H> {
#[inline]
pub fn new(handle: ReductionTransactionHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> ReductionTransactionHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ReductionTransactionRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ReductionTransactionResolver<H>, H: HostTypes> ReductionTransaction<H>
for ResolvedReductionTransaction<'r, R, H>
{
fn transaction_policy(&self) -> &H::HostString {
match &self.record {
Some(r) => r.transaction_policy,
None => H::EMPTY_HOST_STRING,
}
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn transaction_outcome(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn transaction_scope(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn transaction_status(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: ReductionTransactionResolver<H>, H: HostTypes> ResolvedReductionTransaction<'r, R, H> {
#[inline]
pub fn resolve_transaction_outcome<
'r2,
R2: crate::kernel::schema::TermExpressionResolver<H>,
>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.transaction_outcome_handle,
r,
))
}
#[inline]
pub fn resolve_transaction_scope<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.transaction_scope_handle,
r,
))
}
#[inline]
pub fn resolve_transaction_status<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.transaction_status_handle,
r,
))
}
}
#[derive(Debug)]
pub struct PipelineSuccessHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for PipelineSuccessHandle<H> {}
impl<H: HostTypes> Clone for PipelineSuccessHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for PipelineSuccessHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for PipelineSuccessHandle<H> {}
impl<H: HostTypes> core::hash::Hash for PipelineSuccessHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> PipelineSuccessHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait PipelineSuccessResolver<H: HostTypes> {
fn resolve(&self, handle: PipelineSuccessHandle<H>) -> Option<PipelineSuccessRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct PipelineSuccessRecord<H: HostTypes> {
pub grounding_reached: bool,
pub final_grounding: &'static H::HostString,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedPipelineSuccess<'r, R: PipelineSuccessResolver<H>, H: HostTypes> {
handle: PipelineSuccessHandle<H>,
resolver: &'r R,
record: Option<PipelineSuccessRecord<H>>,
}
impl<'r, R: PipelineSuccessResolver<H>, H: HostTypes> ResolvedPipelineSuccess<'r, R, H> {
#[inline]
pub fn new(handle: PipelineSuccessHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> PipelineSuccessHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&PipelineSuccessRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: PipelineSuccessResolver<H>, H: HostTypes> PipelineSuccess<H>
for ResolvedPipelineSuccess<'r, R, H>
{
fn grounding_reached(&self) -> bool {
match &self.record {
Some(r) => r.grounding_reached,
None => false,
}
}
fn final_grounding(&self) -> &H::HostString {
match &self.record {
Some(r) => r.final_grounding,
None => H::EMPTY_HOST_STRING,
}
}
}
#[derive(Debug)]
pub struct PipelineFailureReasonHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for PipelineFailureReasonHandle<H> {}
impl<H: HostTypes> Clone for PipelineFailureReasonHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for PipelineFailureReasonHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for PipelineFailureReasonHandle<H> {}
impl<H: HostTypes> core::hash::Hash for PipelineFailureReasonHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> PipelineFailureReasonHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait PipelineFailureReasonResolver<H: HostTypes> {
fn resolve(
&self,
handle: PipelineFailureReasonHandle<H>,
) -> Option<PipelineFailureReasonRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct PipelineFailureReasonRecord<H: HostTypes> {
pub failure_kind: &'static H::HostString,
pub failure_stage_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedPipelineFailureReason<'r, R: PipelineFailureReasonResolver<H>, H: HostTypes> {
handle: PipelineFailureReasonHandle<H>,
resolver: &'r R,
record: Option<PipelineFailureReasonRecord<H>>,
}
impl<'r, R: PipelineFailureReasonResolver<H>, H: HostTypes>
ResolvedPipelineFailureReason<'r, R, H>
{
#[inline]
pub fn new(handle: PipelineFailureReasonHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> PipelineFailureReasonHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&PipelineFailureReasonRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: PipelineFailureReasonResolver<H>, H: HostTypes> PipelineFailureReason<H>
for ResolvedPipelineFailureReason<'r, R, H>
{
fn failure_kind(&self) -> &H::HostString {
match &self.record {
Some(r) => r.failure_kind,
None => H::EMPTY_HOST_STRING,
}
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn failure_stage(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: PipelineFailureReasonResolver<H>, H: HostTypes>
ResolvedPipelineFailureReason<'r, R, H>
{
#[inline]
pub fn resolve_failure_stage<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.failure_stage_handle,
r,
))
}
}
#[derive(Debug)]
pub struct PreflightCheckHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for PreflightCheckHandle<H> {}
impl<H: HostTypes> Clone for PreflightCheckHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for PreflightCheckHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for PreflightCheckHandle<H> {}
impl<H: HostTypes> core::hash::Hash for PreflightCheckHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> PreflightCheckHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait PreflightCheckResolver<H: HostTypes> {
fn resolve(&self, handle: PreflightCheckHandle<H>) -> Option<PreflightCheckRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct PreflightCheckRecord<H: HostTypes> {
pub preflight_kind: &'static H::HostString,
pub preflight_result_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub preflight_order: u64,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedPreflightCheck<'r, R: PreflightCheckResolver<H>, H: HostTypes> {
handle: PreflightCheckHandle<H>,
resolver: &'r R,
record: Option<PreflightCheckRecord<H>>,
}
impl<'r, R: PreflightCheckResolver<H>, H: HostTypes> ResolvedPreflightCheck<'r, R, H> {
#[inline]
pub fn new(handle: PreflightCheckHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> PreflightCheckHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&PreflightCheckRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: PreflightCheckResolver<H>, H: HostTypes> PreflightCheck<H>
for ResolvedPreflightCheck<'r, R, H>
{
fn preflight_kind(&self) -> &H::HostString {
match &self.record {
Some(r) => r.preflight_kind,
None => H::EMPTY_HOST_STRING,
}
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn preflight_result(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn preflight_order(&self) -> u64 {
match &self.record {
Some(r) => r.preflight_order,
None => 0,
}
}
}
impl<'r, R: PreflightCheckResolver<H>, H: HostTypes> ResolvedPreflightCheck<'r, R, H> {
#[inline]
pub fn resolve_preflight_result<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.preflight_result_handle,
r,
))
}
}
#[derive(Debug)]
pub struct FeasibilityResultHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for FeasibilityResultHandle<H> {}
impl<H: HostTypes> Clone for FeasibilityResultHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for FeasibilityResultHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for FeasibilityResultHandle<H> {}
impl<H: HostTypes> core::hash::Hash for FeasibilityResultHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> FeasibilityResultHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait FeasibilityResultResolver<H: HostTypes> {
fn resolve(&self, handle: FeasibilityResultHandle<H>) -> Option<FeasibilityResultRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct FeasibilityResultRecord<H: HostTypes> {
pub feasibility_kind: &'static H::HostString,
pub feasibility_witness: &'static H::HostString,
pub infeasibility_kind_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedFeasibilityResult<'r, R: FeasibilityResultResolver<H>, H: HostTypes> {
handle: FeasibilityResultHandle<H>,
resolver: &'r R,
record: Option<FeasibilityResultRecord<H>>,
}
impl<'r, R: FeasibilityResultResolver<H>, H: HostTypes> ResolvedFeasibilityResult<'r, R, H> {
#[inline]
pub fn new(handle: FeasibilityResultHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> FeasibilityResultHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&FeasibilityResultRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: FeasibilityResultResolver<H>, H: HostTypes> FeasibilityResult<H>
for ResolvedFeasibilityResult<'r, R, H>
{
fn feasibility_kind(&self) -> &H::HostString {
match &self.record {
Some(r) => r.feasibility_kind,
None => H::EMPTY_HOST_STRING,
}
}
fn feasibility_witness(&self) -> &H::HostString {
match &self.record {
Some(r) => r.feasibility_witness,
None => H::EMPTY_HOST_STRING,
}
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn infeasibility_kind(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: FeasibilityResultResolver<H>, H: HostTypes> ResolvedFeasibilityResult<'r, R, H> {
#[inline]
pub fn resolve_infeasibility_kind<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.infeasibility_kind_handle,
r,
))
}
}
#[derive(Debug)]
pub struct LeaseStateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for LeaseStateHandle<H> {}
impl<H: HostTypes> Clone for LeaseStateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for LeaseStateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for LeaseStateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for LeaseStateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> LeaseStateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait LeaseStateResolver<H: HostTypes> {
fn resolve(&self, handle: LeaseStateHandle<H>) -> Option<LeaseStateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct LeaseStateRecord<H: HostTypes> {
pub lease_phase: &'static H::HostString,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedLeaseState<'r, R: LeaseStateResolver<H>, H: HostTypes> {
handle: LeaseStateHandle<H>,
resolver: &'r R,
record: Option<LeaseStateRecord<H>>,
}
impl<'r, R: LeaseStateResolver<H>, H: HostTypes> ResolvedLeaseState<'r, R, H> {
#[inline]
pub fn new(handle: LeaseStateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> LeaseStateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&LeaseStateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: LeaseStateResolver<H>, H: HostTypes> LeaseState<H> for ResolvedLeaseState<'r, R, H> {
fn lease_phase(&self) -> &H::HostString {
match &self.record {
Some(r) => r.lease_phase,
None => H::EMPTY_HOST_STRING,
}
}
}
#[derive(Debug)]
pub struct ManagedLeaseHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ManagedLeaseHandle<H> {}
impl<H: HostTypes> Clone for ManagedLeaseHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ManagedLeaseHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ManagedLeaseHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ManagedLeaseHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ManagedLeaseHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait ManagedLeaseResolver<H: HostTypes> {
fn resolve(&self, handle: ManagedLeaseHandle<H>) -> Option<ManagedLeaseRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ManagedLeaseRecord<H: HostTypes> {
pub managed_lease_id_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub lease_lifecycle_handle: LeaseStateHandle<H>,
pub expiry_epoch: u64,
pub lease_budget: u64,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedManagedLease<'r, R: ManagedLeaseResolver<H>, H: HostTypes> {
handle: ManagedLeaseHandle<H>,
resolver: &'r R,
record: Option<ManagedLeaseRecord<H>>,
}
impl<'r, R: ManagedLeaseResolver<H>, H: HostTypes> ResolvedManagedLease<'r, R, H> {
#[inline]
pub fn new(handle: ManagedLeaseHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> ManagedLeaseHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ManagedLeaseRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ManagedLeaseResolver<H>, H: HostTypes> ManagedLease<H>
for ResolvedManagedLease<'r, R, H>
{
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn managed_lease_id(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type LeaseState = NullLeaseState<H>;
fn lease_lifecycle(&self) -> &Self::LeaseState {
&<NullLeaseState<H>>::ABSENT
}
fn expiry_epoch(&self) -> u64 {
match &self.record {
Some(r) => r.expiry_epoch,
None => 0,
}
}
fn lease_budget(&self) -> u64 {
match &self.record {
Some(r) => r.lease_budget,
None => 0,
}
}
}
impl<'r, R: ManagedLeaseResolver<H>, H: HostTypes> ResolvedManagedLease<'r, R, H> {
#[inline]
pub fn resolve_managed_lease_id<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.managed_lease_id_handle,
r,
))
}
#[inline]
pub fn resolve_lease_lifecycle<'r2, R2: LeaseStateResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedLeaseState<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedLeaseState::new(record.lease_lifecycle_handle, r))
}
}
#[derive(Debug)]
pub struct LeaseCheckpointHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for LeaseCheckpointHandle<H> {}
impl<H: HostTypes> Clone for LeaseCheckpointHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for LeaseCheckpointHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for LeaseCheckpointHandle<H> {}
impl<H: HostTypes> core::hash::Hash for LeaseCheckpointHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> LeaseCheckpointHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait LeaseCheckpointResolver<H: HostTypes> {
fn resolve(&self, handle: LeaseCheckpointHandle<H>) -> Option<LeaseCheckpointRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct LeaseCheckpointRecord<H: HostTypes> {
pub checkpoint_epoch: u64,
pub checkpoint_state_handle: ReductionStateHandle<H>,
pub lease_remaining_budget: u64,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedLeaseCheckpoint<'r, R: LeaseCheckpointResolver<H>, H: HostTypes> {
handle: LeaseCheckpointHandle<H>,
resolver: &'r R,
record: Option<LeaseCheckpointRecord<H>>,
}
impl<'r, R: LeaseCheckpointResolver<H>, H: HostTypes> ResolvedLeaseCheckpoint<'r, R, H> {
#[inline]
pub fn new(handle: LeaseCheckpointHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> LeaseCheckpointHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&LeaseCheckpointRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: LeaseCheckpointResolver<H>, H: HostTypes> LeaseCheckpoint<H>
for ResolvedLeaseCheckpoint<'r, R, H>
{
fn checkpoint_epoch(&self) -> u64 {
match &self.record {
Some(r) => r.checkpoint_epoch,
None => 0,
}
}
type ReductionState = NullReductionState<H>;
fn checkpoint_state(&self) -> &Self::ReductionState {
&<NullReductionState<H>>::ABSENT
}
fn lease_remaining_budget(&self) -> u64 {
match &self.record {
Some(r) => r.lease_remaining_budget,
None => 0,
}
}
}
impl<'r, R: LeaseCheckpointResolver<H>, H: HostTypes> ResolvedLeaseCheckpoint<'r, R, H> {
#[inline]
pub fn resolve_checkpoint_state<'r2, R2: ReductionStateResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedReductionState<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedReductionState::new(
record.checkpoint_state_handle,
r,
))
}
}
#[derive(Debug)]
pub struct BackPressureSignalHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for BackPressureSignalHandle<H> {}
impl<H: HostTypes> Clone for BackPressureSignalHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for BackPressureSignalHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for BackPressureSignalHandle<H> {}
impl<H: HostTypes> core::hash::Hash for BackPressureSignalHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> BackPressureSignalHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait BackPressureSignalResolver<H: HostTypes> {
fn resolve(&self, handle: BackPressureSignalHandle<H>) -> Option<BackPressureSignalRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct BackPressureSignalRecord<H: HostTypes> {
pub pressure_level: &'static H::HostString,
pub pressure_threshold: H::Decimal,
pub source_stage_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub target_stage_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedBackPressureSignal<'r, R: BackPressureSignalResolver<H>, H: HostTypes> {
handle: BackPressureSignalHandle<H>,
resolver: &'r R,
record: Option<BackPressureSignalRecord<H>>,
}
impl<'r, R: BackPressureSignalResolver<H>, H: HostTypes> ResolvedBackPressureSignal<'r, R, H> {
#[inline]
pub fn new(handle: BackPressureSignalHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> BackPressureSignalHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&BackPressureSignalRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: BackPressureSignalResolver<H>, H: HostTypes> BackPressureSignal<H>
for ResolvedBackPressureSignal<'r, R, H>
{
fn pressure_level(&self) -> &H::HostString {
match &self.record {
Some(r) => r.pressure_level,
None => H::EMPTY_HOST_STRING,
}
}
fn pressure_threshold(&self) -> H::Decimal {
match &self.record {
Some(r) => r.pressure_threshold,
None => H::EMPTY_DECIMAL,
}
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn source_stage(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn target_stage(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: BackPressureSignalResolver<H>, H: HostTypes> ResolvedBackPressureSignal<'r, R, H> {
#[inline]
pub fn resolve_source_stage<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.source_stage_handle,
r,
))
}
#[inline]
pub fn resolve_target_stage<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.target_stage_handle,
r,
))
}
}
#[derive(Debug)]
pub struct DeferredQuerySetHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for DeferredQuerySetHandle<H> {}
impl<H: HostTypes> Clone for DeferredQuerySetHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for DeferredQuerySetHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for DeferredQuerySetHandle<H> {}
impl<H: HostTypes> core::hash::Hash for DeferredQuerySetHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> DeferredQuerySetHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait DeferredQuerySetResolver<H: HostTypes> {
fn resolve(&self, handle: DeferredQuerySetHandle<H>) -> Option<DeferredQuerySetRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct DeferredQuerySetRecord<H: HostTypes> {
pub deferred_count: u64,
pub deferral_epoch: u64,
pub deferral_reason_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedDeferredQuerySet<'r, R: DeferredQuerySetResolver<H>, H: HostTypes> {
handle: DeferredQuerySetHandle<H>,
resolver: &'r R,
record: Option<DeferredQuerySetRecord<H>>,
}
impl<'r, R: DeferredQuerySetResolver<H>, H: HostTypes> ResolvedDeferredQuerySet<'r, R, H> {
#[inline]
pub fn new(handle: DeferredQuerySetHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> DeferredQuerySetHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&DeferredQuerySetRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: DeferredQuerySetResolver<H>, H: HostTypes> DeferredQuerySet<H>
for ResolvedDeferredQuerySet<'r, R, H>
{
fn deferred_count(&self) -> u64 {
match &self.record {
Some(r) => r.deferred_count,
None => 0,
}
}
fn deferral_epoch(&self) -> u64 {
match &self.record {
Some(r) => r.deferral_epoch,
None => 0,
}
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn deferral_reason(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: DeferredQuerySetResolver<H>, H: HostTypes> ResolvedDeferredQuerySet<'r, R, H> {
#[inline]
pub fn resolve_deferral_reason<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.deferral_reason_handle,
r,
))
}
}
#[derive(Debug)]
pub struct SubleaseTransferHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for SubleaseTransferHandle<H> {}
impl<H: HostTypes> Clone for SubleaseTransferHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for SubleaseTransferHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for SubleaseTransferHandle<H> {}
impl<H: HostTypes> core::hash::Hash for SubleaseTransferHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> SubleaseTransferHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait SubleaseTransferResolver<H: HostTypes> {
fn resolve(&self, handle: SubleaseTransferHandle<H>) -> Option<SubleaseTransferRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct SubleaseTransferRecord<H: HostTypes> {
pub source_lease_ref_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub target_lease_ref_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub transferred_budget: u64,
pub transfer_completed: bool,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedSubleaseTransfer<'r, R: SubleaseTransferResolver<H>, H: HostTypes> {
handle: SubleaseTransferHandle<H>,
resolver: &'r R,
record: Option<SubleaseTransferRecord<H>>,
}
impl<'r, R: SubleaseTransferResolver<H>, H: HostTypes> ResolvedSubleaseTransfer<'r, R, H> {
#[inline]
pub fn new(handle: SubleaseTransferHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> SubleaseTransferHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&SubleaseTransferRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: SubleaseTransferResolver<H>, H: HostTypes> SubleaseTransfer<H>
for ResolvedSubleaseTransfer<'r, R, H>
{
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn source_lease_ref(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn target_lease_ref(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn transferred_budget(&self) -> u64 {
match &self.record {
Some(r) => r.transferred_budget,
None => 0,
}
}
fn transfer_completed(&self) -> bool {
match &self.record {
Some(r) => r.transfer_completed,
None => false,
}
}
}
impl<'r, R: SubleaseTransferResolver<H>, H: HostTypes> ResolvedSubleaseTransfer<'r, R, H> {
#[inline]
pub fn resolve_source_lease_ref<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.source_lease_ref_handle,
r,
))
}
#[inline]
pub fn resolve_target_lease_ref<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.target_lease_ref_handle,
r,
))
}
}
#[derive(Debug)]
pub struct ComparisonPredicateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ComparisonPredicateHandle<H> {}
impl<H: HostTypes> Clone for ComparisonPredicateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ComparisonPredicateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ComparisonPredicateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ComparisonPredicateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ComparisonPredicateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait ComparisonPredicateResolver<H: HostTypes> {
fn resolve(&self, handle: ComparisonPredicateHandle<H>)
-> Option<ComparisonPredicateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ComparisonPredicateRecord<H: HostTypes> {
pub comparison_field_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub comparison_operator_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub comparison_value_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedComparisonPredicate<'r, R: ComparisonPredicateResolver<H>, H: HostTypes> {
handle: ComparisonPredicateHandle<H>,
resolver: &'r R,
record: Option<ComparisonPredicateRecord<H>>,
}
impl<'r, R: ComparisonPredicateResolver<H>, H: HostTypes> ResolvedComparisonPredicate<'r, R, H> {
#[inline]
pub fn new(handle: ComparisonPredicateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> ComparisonPredicateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ComparisonPredicateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ComparisonPredicateResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedComparisonPredicate<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<'r, R: ComparisonPredicateResolver<H>, H: HostTypes> ComparisonPredicate<H>
for ResolvedComparisonPredicate<'r, R, H>
{
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn comparison_field(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn comparison_operator(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn comparison_value(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: ComparisonPredicateResolver<H>, H: HostTypes> ResolvedComparisonPredicate<'r, R, H> {
#[inline]
pub fn resolve_comparison_field<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.comparison_field_handle,
r,
))
}
#[inline]
pub fn resolve_comparison_operator<
'r2,
R2: crate::kernel::schema::TermExpressionResolver<H>,
>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.comparison_operator_handle,
r,
))
}
#[inline]
pub fn resolve_comparison_value<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.comparison_value_handle,
r,
))
}
}
#[derive(Debug)]
pub struct ConjunctionPredicateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ConjunctionPredicateHandle<H> {}
impl<H: HostTypes> Clone for ConjunctionPredicateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ConjunctionPredicateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ConjunctionPredicateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ConjunctionPredicateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ConjunctionPredicateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait ConjunctionPredicateResolver<H: HostTypes> {
fn resolve(
&self,
handle: ConjunctionPredicateHandle<H>,
) -> Option<ConjunctionPredicateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ConjunctionPredicateRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedConjunctionPredicate<'r, R: ConjunctionPredicateResolver<H>, H: HostTypes> {
handle: ConjunctionPredicateHandle<H>,
resolver: &'r R,
record: Option<ConjunctionPredicateRecord<H>>,
}
impl<'r, R: ConjunctionPredicateResolver<H>, H: HostTypes> ResolvedConjunctionPredicate<'r, R, H> {
#[inline]
pub fn new(handle: ConjunctionPredicateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> ConjunctionPredicateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ConjunctionPredicateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ConjunctionPredicateResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedConjunctionPredicate<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<'r, R: ConjunctionPredicateResolver<H>, H: HostTypes> ConjunctionPredicate<H>
for ResolvedConjunctionPredicate<'r, R, H>
{
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn conjuncts(&self) -> &[Self::TermExpression] {
&[]
}
}
#[derive(Debug)]
pub struct DisjunctionPredicateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for DisjunctionPredicateHandle<H> {}
impl<H: HostTypes> Clone for DisjunctionPredicateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for DisjunctionPredicateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for DisjunctionPredicateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for DisjunctionPredicateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> DisjunctionPredicateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait DisjunctionPredicateResolver<H: HostTypes> {
fn resolve(
&self,
handle: DisjunctionPredicateHandle<H>,
) -> Option<DisjunctionPredicateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct DisjunctionPredicateRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedDisjunctionPredicate<'r, R: DisjunctionPredicateResolver<H>, H: HostTypes> {
handle: DisjunctionPredicateHandle<H>,
resolver: &'r R,
record: Option<DisjunctionPredicateRecord<H>>,
}
impl<'r, R: DisjunctionPredicateResolver<H>, H: HostTypes> ResolvedDisjunctionPredicate<'r, R, H> {
#[inline]
pub fn new(handle: DisjunctionPredicateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> DisjunctionPredicateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&DisjunctionPredicateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: DisjunctionPredicateResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedDisjunctionPredicate<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<'r, R: DisjunctionPredicateResolver<H>, H: HostTypes> DisjunctionPredicate<H>
for ResolvedDisjunctionPredicate<'r, R, H>
{
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn disjuncts(&self) -> &[Self::TermExpression] {
&[]
}
}
#[derive(Debug)]
pub struct NegationPredicateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for NegationPredicateHandle<H> {}
impl<H: HostTypes> Clone for NegationPredicateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for NegationPredicateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for NegationPredicateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for NegationPredicateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> NegationPredicateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait NegationPredicateResolver<H: HostTypes> {
fn resolve(&self, handle: NegationPredicateHandle<H>) -> Option<NegationPredicateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct NegationPredicateRecord<H: HostTypes> {
pub negated_predicate_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedNegationPredicate<'r, R: NegationPredicateResolver<H>, H: HostTypes> {
handle: NegationPredicateHandle<H>,
resolver: &'r R,
record: Option<NegationPredicateRecord<H>>,
}
impl<'r, R: NegationPredicateResolver<H>, H: HostTypes> ResolvedNegationPredicate<'r, R, H> {
#[inline]
pub fn new(handle: NegationPredicateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> NegationPredicateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&NegationPredicateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: NegationPredicateResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedNegationPredicate<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<'r, R: NegationPredicateResolver<H>, H: HostTypes> NegationPredicate<H>
for ResolvedNegationPredicate<'r, R, H>
{
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn negated_predicate(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: NegationPredicateResolver<H>, H: HostTypes> ResolvedNegationPredicate<'r, R, H> {
#[inline]
pub fn resolve_negated_predicate<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.negated_predicate_handle,
r,
))
}
}
#[derive(Debug)]
pub struct MembershipPredicateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for MembershipPredicateHandle<H> {}
impl<H: HostTypes> Clone for MembershipPredicateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for MembershipPredicateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for MembershipPredicateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for MembershipPredicateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> MembershipPredicateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait MembershipPredicateResolver<H: HostTypes> {
fn resolve(&self, handle: MembershipPredicateHandle<H>)
-> Option<MembershipPredicateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct MembershipPredicateRecord<H: HostTypes> {
pub membership_set_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub membership_element_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedMembershipPredicate<'r, R: MembershipPredicateResolver<H>, H: HostTypes> {
handle: MembershipPredicateHandle<H>,
resolver: &'r R,
record: Option<MembershipPredicateRecord<H>>,
}
impl<'r, R: MembershipPredicateResolver<H>, H: HostTypes> ResolvedMembershipPredicate<'r, R, H> {
#[inline]
pub fn new(handle: MembershipPredicateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> MembershipPredicateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&MembershipPredicateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: MembershipPredicateResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedMembershipPredicate<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<'r, R: MembershipPredicateResolver<H>, H: HostTypes> MembershipPredicate<H>
for ResolvedMembershipPredicate<'r, R, H>
{
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn membership_set(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn membership_element(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: MembershipPredicateResolver<H>, H: HostTypes> ResolvedMembershipPredicate<'r, R, H> {
#[inline]
pub fn resolve_membership_set<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.membership_set_handle,
r,
))
}
#[inline]
pub fn resolve_membership_element<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.membership_element_handle,
r,
))
}
}
#[derive(Debug)]
pub struct GroundingPredicateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for GroundingPredicateHandle<H> {}
impl<H: HostTypes> Clone for GroundingPredicateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for GroundingPredicateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for GroundingPredicateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for GroundingPredicateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> GroundingPredicateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait GroundingPredicateResolver<H: HostTypes> {
fn resolve(&self, handle: GroundingPredicateHandle<H>) -> Option<GroundingPredicateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct GroundingPredicateRecord<H: HostTypes> {
pub grounding_threshold: u64,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedGroundingPredicate<'r, R: GroundingPredicateResolver<H>, H: HostTypes> {
handle: GroundingPredicateHandle<H>,
resolver: &'r R,
record: Option<GroundingPredicateRecord<H>>,
}
impl<'r, R: GroundingPredicateResolver<H>, H: HostTypes> ResolvedGroundingPredicate<'r, R, H> {
#[inline]
pub fn new(handle: GroundingPredicateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> GroundingPredicateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&GroundingPredicateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: GroundingPredicateResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedGroundingPredicate<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<'r, R: GroundingPredicateResolver<H>, H: HostTypes> GroundingPredicate<H>
for ResolvedGroundingPredicate<'r, R, H>
{
fn grounding_threshold(&self) -> u64 {
match &self.record {
Some(r) => r.grounding_threshold,
None => 0,
}
}
}
#[derive(Debug)]
pub struct SiteCoveragePredicateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for SiteCoveragePredicateHandle<H> {}
impl<H: HostTypes> Clone for SiteCoveragePredicateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for SiteCoveragePredicateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for SiteCoveragePredicateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for SiteCoveragePredicateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> SiteCoveragePredicateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait SiteCoveragePredicateResolver<H: HostTypes> {
fn resolve(
&self,
handle: SiteCoveragePredicateHandle<H>,
) -> Option<SiteCoveragePredicateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct SiteCoveragePredicateRecord<H: HostTypes> {
pub coverage_target: u64,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedSiteCoveragePredicate<'r, R: SiteCoveragePredicateResolver<H>, H: HostTypes> {
handle: SiteCoveragePredicateHandle<H>,
resolver: &'r R,
record: Option<SiteCoveragePredicateRecord<H>>,
}
impl<'r, R: SiteCoveragePredicateResolver<H>, H: HostTypes>
ResolvedSiteCoveragePredicate<'r, R, H>
{
#[inline]
pub fn new(handle: SiteCoveragePredicateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> SiteCoveragePredicateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&SiteCoveragePredicateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: SiteCoveragePredicateResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedSiteCoveragePredicate<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<'r, R: SiteCoveragePredicateResolver<H>, H: HostTypes> SiteCoveragePredicate<H>
for ResolvedSiteCoveragePredicate<'r, R, H>
{
fn coverage_target(&self) -> u64 {
match &self.record {
Some(r) => r.coverage_target,
None => 0,
}
}
}
#[derive(Debug)]
pub struct EqualsPredicateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for EqualsPredicateHandle<H> {}
impl<H: HostTypes> Clone for EqualsPredicateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for EqualsPredicateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for EqualsPredicateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for EqualsPredicateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> EqualsPredicateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait EqualsPredicateResolver<H: HostTypes> {
fn resolve(&self, handle: EqualsPredicateHandle<H>) -> Option<EqualsPredicateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct EqualsPredicateRecord<H: HostTypes> {
pub equality_left_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub equality_right_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedEqualsPredicate<'r, R: EqualsPredicateResolver<H>, H: HostTypes> {
handle: EqualsPredicateHandle<H>,
resolver: &'r R,
record: Option<EqualsPredicateRecord<H>>,
}
impl<'r, R: EqualsPredicateResolver<H>, H: HostTypes> ResolvedEqualsPredicate<'r, R, H> {
#[inline]
pub fn new(handle: EqualsPredicateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> EqualsPredicateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&EqualsPredicateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: EqualsPredicateResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedEqualsPredicate<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<'r, R: EqualsPredicateResolver<H>, H: HostTypes> EqualsPredicate<H>
for ResolvedEqualsPredicate<'r, R, H>
{
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn equality_left(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn equality_right(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: EqualsPredicateResolver<H>, H: HostTypes> ResolvedEqualsPredicate<'r, R, H> {
#[inline]
pub fn resolve_equality_left<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.equality_left_handle,
r,
))
}
#[inline]
pub fn resolve_equality_right<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.equality_right_handle,
r,
))
}
}
#[derive(Debug)]
pub struct NonNullPredicateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for NonNullPredicateHandle<H> {}
impl<H: HostTypes> Clone for NonNullPredicateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for NonNullPredicateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for NonNullPredicateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for NonNullPredicateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> NonNullPredicateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait NonNullPredicateResolver<H: HostTypes> {
fn resolve(&self, handle: NonNullPredicateHandle<H>) -> Option<NonNullPredicateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct NonNullPredicateRecord<H: HostTypes> {
pub non_null_field: u64,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedNonNullPredicate<'r, R: NonNullPredicateResolver<H>, H: HostTypes> {
handle: NonNullPredicateHandle<H>,
resolver: &'r R,
record: Option<NonNullPredicateRecord<H>>,
}
impl<'r, R: NonNullPredicateResolver<H>, H: HostTypes> ResolvedNonNullPredicate<'r, R, H> {
#[inline]
pub fn new(handle: NonNullPredicateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> NonNullPredicateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&NonNullPredicateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: NonNullPredicateResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedNonNullPredicate<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<'r, R: NonNullPredicateResolver<H>, H: HostTypes> NonNullPredicate<H>
for ResolvedNonNullPredicate<'r, R, H>
{
fn non_null_field(&self) -> u64 {
match &self.record {
Some(r) => r.non_null_field,
None => 0,
}
}
}
#[derive(Debug)]
pub struct QuerySubtypePredicateHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for QuerySubtypePredicateHandle<H> {}
impl<H: HostTypes> Clone for QuerySubtypePredicateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for QuerySubtypePredicateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for QuerySubtypePredicateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for QuerySubtypePredicateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> QuerySubtypePredicateHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait QuerySubtypePredicateResolver<H: HostTypes> {
fn resolve(
&self,
handle: QuerySubtypePredicateHandle<H>,
) -> Option<QuerySubtypePredicateRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct QuerySubtypePredicateRecord<H: HostTypes> {
pub query_type_ref_handle: crate::kernel::schema::TermExpressionHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedQuerySubtypePredicate<'r, R: QuerySubtypePredicateResolver<H>, H: HostTypes> {
handle: QuerySubtypePredicateHandle<H>,
resolver: &'r R,
record: Option<QuerySubtypePredicateRecord<H>>,
}
impl<'r, R: QuerySubtypePredicateResolver<H>, H: HostTypes>
ResolvedQuerySubtypePredicate<'r, R, H>
{
#[inline]
pub fn new(handle: QuerySubtypePredicateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> QuerySubtypePredicateHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&QuerySubtypePredicateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: QuerySubtypePredicateResolver<H>, H: HostTypes> PredicateExpression<H>
for ResolvedQuerySubtypePredicate<'r, R, H>
{
fn predicate_field(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_operator(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn predicate_value(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
impl<'r, R: QuerySubtypePredicateResolver<H>, H: HostTypes> QuerySubtypePredicate<H>
for ResolvedQuerySubtypePredicate<'r, R, H>
{
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn query_type_ref(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
}
impl<'r, R: QuerySubtypePredicateResolver<H>, H: HostTypes>
ResolvedQuerySubtypePredicate<'r, R, H>
{
#[inline]
pub fn resolve_query_type_ref<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.query_type_ref_handle,
r,
))
}
}
#[derive(Debug)]
pub struct CompileUnitHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for CompileUnitHandle<H> {}
impl<H: HostTypes> Clone for CompileUnitHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for CompileUnitHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for CompileUnitHandle<H> {}
impl<H: HostTypes> core::hash::Hash for CompileUnitHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> CompileUnitHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait CompileUnitResolver<H: HostTypes> {
fn resolve(&self, handle: CompileUnitHandle<H>) -> Option<CompileUnitRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct CompileUnitRecord<H: HostTypes> {
pub root_term_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub unit_witt_level: WittLevel,
pub thermodynamic_budget: &'static H::HostString,
pub unit_address_handle: crate::kernel::address::ElementHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedCompileUnit<'r, R: CompileUnitResolver<H>, H: HostTypes> {
handle: CompileUnitHandle<H>,
resolver: &'r R,
record: Option<CompileUnitRecord<H>>,
}
impl<'r, R: CompileUnitResolver<H>, H: HostTypes> ResolvedCompileUnit<'r, R, H> {
#[inline]
pub fn new(handle: CompileUnitHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> CompileUnitHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&CompileUnitRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: CompileUnitResolver<H>, H: HostTypes> CompileUnit<H> for ResolvedCompileUnit<'r, R, H> {
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn root_term(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
fn unit_witt_level(&self) -> WittLevel {
match &self.record {
Some(r) => r.unit_witt_level,
None => <WittLevel>::default(),
}
}
fn thermodynamic_budget(&self) -> &H::HostString {
match &self.record {
Some(r) => r.thermodynamic_budget,
None => H::EMPTY_HOST_STRING,
}
}
fn target_domains(&self) -> &[VerificationDomain] {
&[]
}
type Element = crate::kernel::address::NullElement<H>;
fn unit_address(&self) -> &Self::Element {
&<crate::kernel::address::NullElement<H>>::ABSENT
}
}
impl<'r, R: CompileUnitResolver<H>, H: HostTypes> ResolvedCompileUnit<'r, R, H> {
#[inline]
pub fn resolve_root_term<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.root_term_handle,
r,
))
}
#[inline]
pub fn resolve_unit_address<'r2, R2: crate::kernel::address::ElementResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::address::ResolvedElement<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::address::ResolvedElement::new(
record.unit_address_handle,
r,
))
}
}
#[derive(Debug)]
pub struct FailureFieldHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for FailureFieldHandle<H> {}
impl<H: HostTypes> Clone for FailureFieldHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for FailureFieldHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for FailureFieldHandle<H> {}
impl<H: HostTypes> core::hash::Hash for FailureFieldHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> FailureFieldHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait FailureFieldResolver<H: HostTypes> {
fn resolve(&self, handle: FailureFieldHandle<H>) -> Option<FailureFieldRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct FailureFieldRecord<H: HostTypes> {
pub of_failure: &'static H::HostString,
pub field_name: &'static H::HostString,
pub field_type: &'static H::HostString,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedFailureField<'r, R: FailureFieldResolver<H>, H: HostTypes> {
handle: FailureFieldHandle<H>,
resolver: &'r R,
record: Option<FailureFieldRecord<H>>,
}
impl<'r, R: FailureFieldResolver<H>, H: HostTypes> ResolvedFailureField<'r, R, H> {
#[inline]
pub fn new(handle: FailureFieldHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> FailureFieldHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&FailureFieldRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: FailureFieldResolver<H>, H: HostTypes> FailureField<H>
for ResolvedFailureField<'r, R, H>
{
fn of_failure(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn field_name(&self) -> &H::HostString {
match &self.record {
Some(r) => r.field_name,
None => H::EMPTY_HOST_STRING,
}
}
fn field_type(&self) -> &H::HostString {
match &self.record {
Some(r) => r.field_type,
None => H::EMPTY_HOST_STRING,
}
}
}
#[derive(Debug)]
pub struct SatBoundHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for SatBoundHandle<H> {}
impl<H: HostTypes> Clone for SatBoundHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for SatBoundHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for SatBoundHandle<H> {}
impl<H: HostTypes> core::hash::Hash for SatBoundHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> SatBoundHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait SatBoundResolver<H: HostTypes> {
fn resolve(&self, handle: SatBoundHandle<H>) -> Option<SatBoundRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct SatBoundRecord<H: HostTypes> {
pub max_var_count: u64,
pub max_clause_count: u64,
pub max_literals_per_clause: u64,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedSatBound<'r, R: SatBoundResolver<H>, H: HostTypes> {
handle: SatBoundHandle<H>,
resolver: &'r R,
record: Option<SatBoundRecord<H>>,
}
impl<'r, R: SatBoundResolver<H>, H: HostTypes> ResolvedSatBound<'r, R, H> {
#[inline]
pub fn new(handle: SatBoundHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> SatBoundHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&SatBoundRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: SatBoundResolver<H>, H: HostTypes> SatBound<H> for ResolvedSatBound<'r, R, H> {
fn max_var_count(&self) -> u64 {
match &self.record {
Some(r) => r.max_var_count,
None => 0,
}
}
fn max_clause_count(&self) -> u64 {
match &self.record {
Some(r) => r.max_clause_count,
None => 0,
}
}
fn max_literals_per_clause(&self) -> u64 {
match &self.record {
Some(r) => r.max_literals_per_clause,
None => 0,
}
}
}
#[derive(Debug)]
pub struct TimingBoundHandle<H: HostTypes> {
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for TimingBoundHandle<H> {}
impl<H: HostTypes> Clone for TimingBoundHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for TimingBoundHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for TimingBoundHandle<H> {}
impl<H: HostTypes> core::hash::Hash for TimingBoundHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> TimingBoundHandle<H> {
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
pub trait TimingBoundResolver<H: HostTypes> {
fn resolve(&self, handle: TimingBoundHandle<H>) -> Option<TimingBoundRecord<H>>;
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct TimingBoundRecord<H: HostTypes> {
pub preflight_budget_ns: u64,
pub runtime_budget_ns: u64,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
pub struct ResolvedTimingBound<'r, R: TimingBoundResolver<H>, H: HostTypes> {
handle: TimingBoundHandle<H>,
resolver: &'r R,
record: Option<TimingBoundRecord<H>>,
}
impl<'r, R: TimingBoundResolver<H>, H: HostTypes> ResolvedTimingBound<'r, R, H> {
#[inline]
pub fn new(handle: TimingBoundHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
#[inline]
#[must_use]
pub const fn handle(&self) -> TimingBoundHandle<H> {
self.handle
}
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&TimingBoundRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: TimingBoundResolver<H>, H: HostTypes> TimingBound<H> for ResolvedTimingBound<'r, R, H> {
fn preflight_budget_ns(&self) -> u64 {
match &self.record {
Some(r) => r.preflight_budget_ns,
None => 0,
}
}
fn runtime_budget_ns(&self) -> u64 {
match &self.record {
Some(r) => r.runtime_budget_ns,
None => 0,
}
}
}
pub mod stage_initialization {
pub const EXPECTED_PHASE: &str = "Ω⁰";
pub const STAGE_INDEX: i64 = 0;
pub const STAGE_NAME: &str = "Initialization";
}
pub mod stage_declare {
pub const EXPECTED_PHASE: &str = "Ω¹";
pub const STAGE_INDEX: i64 = 1;
pub const STAGE_NAME: &str = "Declare";
}
pub mod stage_factorize {
pub const EXPECTED_PHASE: &str = "Ω²";
pub const STAGE_INDEX: i64 = 2;
pub const STAGE_NAME: &str = "Factorize";
}
pub mod stage_resolve {
pub const EXPECTED_PHASE: &str = "Ω³";
pub const STAGE_INDEX: i64 = 3;
pub const STAGE_NAME: &str = "Resolve";
}
pub mod stage_attest {
pub const EXPECTED_PHASE: &str = "Ω⁴";
pub const STAGE_INDEX: i64 = 4;
pub const STAGE_NAME: &str = "Attest";
}
pub mod stage_extract {
pub const EXPECTED_PHASE: &str = "Ω⁵";
pub const STAGE_INDEX: i64 = 5;
pub const STAGE_NAME: &str = "Extract";
}
pub mod stage_convergence {
pub const EXPECTED_PHASE: &str = "π";
pub const STAGE_INDEX: i64 = 6;
pub const STAGE_NAME: &str = "Convergence";
}
pub mod gate_initialization {
pub const GATE_EXPECTED_PHASE: &str = "Ω⁰";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_initialization";
}
pub mod gate_declare {
pub const GATE_EXPECTED_PHASE: &str = "Ω¹";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_declare";
}
pub mod gate_factorize {
pub const GATE_EXPECTED_PHASE: &str = "Ω²";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_factorize";
}
pub mod gate_resolve {
pub const GATE_EXPECTED_PHASE: &str = "Ω³";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_resolve";
}
pub mod gate_attest {
pub const GATE_EXPECTED_PHASE: &str = "Ω⁴";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_attest";
}
pub mod gate_extract {
pub const GATE_EXPECTED_PHASE: &str = "Ω⁵";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/reduction/stage_extract";
}
pub mod euler_reduction_instance {
pub const CONVERGENCE_ANGLE: &str = "π";
pub const PHASE_PARAMETER: &str = "e^{iπ/6}";
pub const STAGE_COUNT: i64 = 6;
}
pub mod phase_schedule {
pub const BASE_ANGLE: &str = "π/6";
pub const ROTATION_SCHEDULE: &str = "Ω⁰, Ω¹, Ω², Ω³, Ω⁴, Ω⁵";
}
pub mod convergence_target {
pub const TARGET_ANGLE: &str = "π";
}
pub mod conjugate_rollback {
pub const ROLLBACK_TARGET: &str = "https://uor.foundation/reduction/stage_initialization";
}
pub mod dispatch_miss {
pub const FAILURE_KIND: &str = "DispatchMiss";
}
pub mod grounding_failure {
pub const FAILURE_KIND: &str = "GroundingFailure";
}
pub mod convergence_stall {
pub const FAILURE_KIND: &str = "ConvergenceStall";
}
pub mod contradiction_detected {
pub const FAILURE_KIND: &str = "ContradictionDetected";
}
pub mod coherence_violation {
pub const FAILURE_KIND: &str = "CoherenceViolation";
}
pub mod shape_mismatch {
pub const FAILURE_KIND: &str = "ShapeMismatch";
}
pub mod full_grounding_success {
pub const GROUNDING_REACHED: bool = true;
}
pub mod feasibility_check {
pub const PREFLIGHT_KIND: &str = "Feasibility";
pub const PREFLIGHT_ORDER: i64 = 1;
}
pub mod dispatch_coverage_check {
pub const PREFLIGHT_KIND: &str = "DispatchCoverage";
pub const PREFLIGHT_ORDER: i64 = 2;
}
pub mod package_coherence_check {
pub const PREFLIGHT_KIND: &str = "PackageCoherence";
pub const PREFLIGHT_ORDER: i64 = 3;
}
pub mod default_service_window {
pub const WINDOW_OFFSET: i64 = 0;
pub const WINDOW_SIZE: i64 = 3;
}
pub mod advance_init_to_declare {
pub const ADVANCE_FROM: &str = "https://uor.foundation/reduction/stage_initialization";
pub const ADVANCE_TO: &str = "https://uor.foundation/reduction/stage_declare";
}
pub mod atomic_transaction {
pub const TRANSACTION_POLICY: &str = "AllOrNothing";
}
pub mod empty_guard {}
pub mod identity_effect {}
pub mod true_predicate {
pub const PREDICATE_FIELD: &str = "*";
pub const PREDICATE_OPERATOR: &str = "true";
pub const PREDICATE_VALUE: &str = "*";
}
pub mod noop_bind {
pub const BIND_TARGET: &str = "none";
pub const BIND_VALUE: &str = "unchanged";
}
pub mod pending {
pub const LEASE_PHASE: &str = "Pending";
}
pub mod active {
pub const LEASE_PHASE: &str = "Active";
}
pub mod released {
pub const LEASE_PHASE: &str = "Released";
}
pub mod expired {
pub const LEASE_PHASE: &str = "Expired";
}
pub mod suspended {
pub const LEASE_PHASE: &str = "Suspended";
}
pub mod feasibility_witness {
pub const FEASIBILITY_KIND: &str = "Feasible";
}
pub mod infeasibility_witness {
pub const FEASIBILITY_KIND: &str = "Infeasible";
pub const FEASIBILITY_WITNESS: &str = "obstruction detected";
}
pub mod preflight_timing {
pub const PREFLIGHT_KIND: &str = "Timing";
pub const PREFLIGHT_ORDER: i64 = 4;
}
pub mod runtime_timing {
pub const PREFLIGHT_KIND: &str = "RuntimeTiming";
pub const PREFLIGHT_ORDER: i64 = 5;
}
pub mod budget_solvency_check {
pub const PREFLIGHT_KIND: &str = "BudgetSolvency";
pub const PREFLIGHT_ORDER: i64 = 0;
}
pub mod back_pressure_default {
pub const PRESSURE_LEVEL: &str = "Medium";
pub const PRESSURE_THRESHOLD_BITS: u64 = 4604930618986332160_u64;
}
pub mod dispatch_miss_query_iri_field {
pub const FIELD_NAME: &str = "query_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/DispatchMiss";
}
pub mod dispatch_miss_table_iri_field {
pub const FIELD_NAME: &str = "table_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/DispatchMiss";
}
pub mod grounding_failure_reason_iri_field {
pub const FIELD_NAME: &str = "reason_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/GroundingFailure";
}
pub mod convergence_stall_stage_field {
pub const FIELD_NAME: &str = "stage_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ConvergenceStall";
}
pub mod convergence_stall_angle_field {
pub const FIELD_NAME: &str = "angle_milliradians";
pub const FIELD_TYPE: &str = "i64";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ConvergenceStall";
}
pub mod contradiction_detected_at_step_field {
pub const FIELD_NAME: &str = "at_step";
pub const FIELD_TYPE: &str = "usize";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ContradictionDetected";
}
pub mod contradiction_detected_trace_iri_field {
pub const FIELD_NAME: &str = "trace_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ContradictionDetected";
}
pub mod coherence_violation_site_position_field {
pub const FIELD_NAME: &str = "site_position";
pub const FIELD_TYPE: &str = "usize";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/CoherenceViolation";
}
pub mod coherence_violation_constraint_iri_field {
pub const FIELD_NAME: &str = "constraint_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/CoherenceViolation";
}
pub mod shape_mismatch_expected_field {
pub const FIELD_NAME: &str = "expected";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ShapeMismatch";
}
pub mod shape_mismatch_got_field {
pub const FIELD_NAME: &str = "got";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/reduction/ShapeMismatch";
}
pub mod lift_obstruction_site_position_field {
pub const FIELD_NAME: &str = "site_position";
pub const FIELD_TYPE: &str = "usize";
pub const OF_FAILURE: &str = "https://uor.foundation/failure/LiftObstructionFailure";
}
pub mod lift_obstruction_obstruction_class_iri_field {
pub const FIELD_NAME: &str = "obstruction_class_iri";
pub const FIELD_TYPE: &str = "&'static str";
pub const OF_FAILURE: &str = "https://uor.foundation/failure/LiftObstructionFailure";
}
pub mod two_sat_bound {
pub const MAX_CLAUSE_COUNT: i64 = 512;
pub const MAX_LITERALS_PER_CLAUSE: i64 = 2;
pub const MAX_VAR_COUNT: i64 = 256;
}
pub mod horn_sat_bound {
pub const MAX_CLAUSE_COUNT: i64 = 512;
pub const MAX_LITERALS_PER_CLAUSE: i64 = 8;
pub const MAX_VAR_COUNT: i64 = 256;
}
pub mod preflight_timing_bound {
pub const PREFLIGHT_BUDGET_NS: i64 = 10000000;
}
pub mod runtime_timing_bound {
pub const RUNTIME_BUDGET_NS: i64 = 10000000;
}