pub struct CeremonyInstance { /* private fields */ }Implementations§
Source§impl CeremonyInstance
impl CeremonyInstance
Sourcepub fn approve_guard(
&mut self,
definition: &CeremonyDefinition,
guard_name: &GuardName,
approved_by: RoleId,
approved_by_kind: AuditActorKind,
now: OffsetDateTime,
) -> Result<(), DomainError>
pub fn approve_guard( &mut self, definition: &CeremonyDefinition, guard_name: &GuardName, approved_by: RoleId, approved_by_kind: AuditActorKind, now: OffsetDateTime, ) -> Result<(), DomainError>
Approving is checked the way deferring is. It used to take no definition at all, so any name at all could be “approved” — which wrote that name into the session context, told the caller it had succeeded, and left a session that would never move.
Approving ahead of time is still allowed: unlike a deferral, which answers a decision being asked for now, a person may settle a guard before the work leading up to it is finished.
pub fn defer_guard( &mut self, definition: &CeremonyDefinition, guard_name: GuardName, content: CeremonyGuardDeferralContent, deferred_by: RoleId, deferred_by_kind: AuditActorKind, now: OffsetDateTime, ) -> Result<(), DomainError>
Source§impl CeremonyInstance
impl CeremonyInstance
pub fn request_intervention_as( &mut self, definition: &CeremonyDefinition, intervention_id: CeremonyInterventionId, role_id: RoleId, kind: CeremonyInterventionKind, target: CeremonyInterventionTarget, content: CeremonyInterventionContent, now: OffsetDateTime, ) -> Result<(), DomainError>
pub fn request_intervention_with_provenance_as( &mut self, definition: &CeremonyDefinition, intervention_id: CeremonyInterventionId, role_id: RoleId, kind: CeremonyInterventionKind, target: CeremonyInterventionTarget, content: CeremonyInterventionContent, provenance: Option<CeremonyInterventionProvenance>, now: OffsetDateTime, ) -> Result<(), DomainError>
pub fn respond_to_intervention_as( &mut self, definition: &CeremonyDefinition, intervention_id: &CeremonyInterventionId, role_id: RoleId, content: CeremonyInterventionContent, now: OffsetDateTime, ) -> Result<(), DomainError>
pub fn prepare_evidence_request_as( &self, definition: &CeremonyDefinition, intervention_id: CeremonyInterventionId, role_id: RoleId, source_id: CeremonyEvidenceSourceId, query: CeremonyInterventionContent, ) -> Result<CeremonyEvidenceRequest, DomainError>
pub fn respond_to_intervention_with_evidence_as( &mut self, definition: &CeremonyDefinition, intervention_id: &CeremonyInterventionId, role_id: RoleId, evidence_pack: CeremonyEvidencePack, now: OffsetDateTime, ) -> Result<(), DomainError>
Sourcepub fn assert_reason_as(
&mut self,
definition: &CeremonyDefinition,
role_id: RoleId,
from: CeremonyRecordRef,
to: CeremonyRecordRef,
kind: CeremonyReasonKind,
why: impl Into<String>,
confidence: MemoryConfidence,
now: OffsetDateTime,
) -> Result<(), DomainError>
pub fn assert_reason_as( &mut self, definition: &CeremonyDefinition, role_id: RoleId, from: CeremonyRecordRef, to: CeremonyRecordRef, kind: CeremonyReasonKind, why: impl Into<String>, confidence: MemoryConfidence, now: OffsetDateTime, ) -> Result<(), DomainError>
State why one thing here led to another.
Its own act rather than a field on contributing, because a reason is often known later — “in fact I did that because…” is how people reason — and because a field gets filled in by inertia while an act is chosen.
What it refuses is the point:
- a kind only the engine may assert, because a participant able to relabel the structure could rewrite the session’s shape;
- a kind only an author may assert, claimed by anyone else, because nobody else has access to another’s reasoning;
- either end naming something this session never produced.
pub fn close_intervention_as( &mut self, definition: &CeremonyDefinition, intervention_id: &CeremonyInterventionId, role_id: &RoleId, now: OffsetDateTime, ) -> Result<(), DomainError>
Source§impl CeremonyInstance
impl CeremonyInstance
Sourcepub fn bind_participant(
&mut self,
definition: &CeremonyDefinition,
role_id: RoleId,
specialty: Specialty,
now: OffsetDateTime,
) -> Result<(), DomainError>
pub fn bind_participant( &mut self, definition: &CeremonyDefinition, role_id: RoleId, specialty: Specialty, now: OffsetDateTime, ) -> Result<(), DomainError>
Seat a role for this session.
Rebinding is allowed and deliberate: a panel can become unavailable halfway through a working session, and a ceremony that could not be re-seated would have to be abandoned and started again, losing everything already decided. What was seated before stays in the journal; the instance carries who is seated now, which is what the next step needs.
pub fn participant_bindings( &self, ) -> &BTreeMap<RoleId, CeremonyParticipantBinding>
Sourcepub fn bound_specialty(&self, role_id: &RoleId) -> Option<&Specialty>
pub fn bound_specialty(&self, role_id: &RoleId) -> Option<&Specialty>
The specialty a role’s work should be put to, if this session
seated one. None means the definition decides, as usual.
Source§impl CeremonyInstance
impl CeremonyInstance
pub fn start_step_as( &mut self, definition: &CeremonyDefinition, role_id: &RoleId, step_id: &StepId, lease: StepLease, now: OffsetDateTime, ) -> Result<StepAttempt, DomainError>
pub fn start_step( &mut self, definition: &CeremonyDefinition, step_id: &StepId, lease: StepLease, now: OffsetDateTime, ) -> Result<StepAttempt, DomainError>
pub fn apply_step_result( &mut self, definition: &CeremonyDefinition, step_id: &StepId, result: StepResult, now: OffsetDateTime, ) -> Result<(), DomainError>
Source§impl CeremonyInstance
impl CeremonyInstance
pub fn apply_transition_as( &mut self, definition: &CeremonyDefinition, role_id: &RoleId, trigger: &TransitionTrigger, now: OffsetDateTime, ) -> Result<StateId, DomainError>
pub fn apply_transition( &mut self, definition: &CeremonyDefinition, trigger: &TransitionTrigger, now: OffsetDateTime, ) -> Result<StateId, DomainError>
Source§impl CeremonyInstance
impl CeremonyInstance
Sourcepub fn start(
id: CeremonyId,
definition: &CeremonyDefinition,
context: CeremonyContext,
now: OffsetDateTime,
) -> Self
pub fn start( id: CeremonyId, definition: &CeremonyDefinition, context: CeremonyContext, now: OffsetDateTime, ) -> Self
Start from a definition supplied for this run.
Nothing binds the instance to a definition that can be looked up
later; that is what Self::start_bound is for.
Sourcepub fn start_bound(
id: CeremonyId,
published: &PublishedCeremonyDefinition,
context: CeremonyContext,
now: OffsetDateTime,
) -> Self
pub fn start_bound( id: CeremonyId, published: &PublishedCeremonyDefinition, context: CeremonyContext, now: OffsetDateTime, ) -> Self
Start from a published definition, recording its digest.
The digest travels with the instance so a later reader can verify which definition ran instead of taking the name and version on trust.
Sourcepub fn bound_definition(&self) -> Option<CeremonyDefinitionDigest>
pub fn bound_definition(&self) -> Option<CeremonyDefinitionDigest>
The digest of the published definition this instance runs, if it was started from one.
Sourcepub fn is_bound_to_a_published_definition(&self) -> bool
pub fn is_bound_to_a_published_definition(&self) -> bool
Whether this instance runs a definition that can be looked up and checked, rather than one supplied for the run.
Sourcepub fn migrate_definition_binding(
&mut self,
migration: &CeremonyDefinitionDigestMigration,
) -> Result<bool, DomainError>
pub fn migrate_definition_binding( &mut self, migration: &CeremonyDefinitionDigestMigration, ) -> Result<bool, DomainError>
Replace a legacy publication identity after the same definition has been verified under a successor digest scheme.
This is deliberately narrower than a general rebind operation. A running ceremony cannot be moved to different content, name or version. Storage migrations may only replace the expected legacy identity with the identity of the already verified publication.
pub fn id(&self) -> &CeremonyId
pub fn definition_name(&self) -> &CeremonyName
pub fn definition_version(&self) -> &CeremonyVersion
pub fn current_state(&self) -> &StateId
pub fn step_records(&self) -> &BTreeMap<StepId, StepExecutionRecord>
pub fn step_record(&self, step_id: &StepId) -> Option<&StepExecutionRecord>
Sourcepub fn step_record_history(&self, step_id: &StepId) -> &[StepExecutionRecord]
pub fn step_record_history(&self, step_id: &StepId) -> &[StepExecutionRecord]
Finished iterations before the current record, in execution order.
Sourcepub fn step_repeat_limit_reached(
&self,
definition: &CeremonyDefinition,
step_id: &StepId,
) -> bool
pub fn step_repeat_limit_reached( &self, definition: &CeremonyDefinition, step_id: &StepId, ) -> bool
Whether a repeating step consumed its last permitted iteration without satisfying its declared stop condition.
pub fn interventions(&self) -> &[CeremonyIntervention]
pub fn guard_deferrals(&self) -> &[CeremonyGuardDeferral]
Sourcepub fn guard_approvals(&self) -> &[CeremonyGuardApproval]
pub fn guard_approvals(&self) -> &[CeremonyGuardApproval]
Who let each human guard through, in the order they did.
Empty for a session written before approvals recorded an approver, which is the truth about those sessions rather than a gap to paper over.
Sourcepub fn transitions(&self) -> &[CeremonyTransitionRecord]
pub fn transitions(&self) -> &[CeremonyTransitionRecord]
Every move this session made, in the order it made them.
Sourcepub fn reasons(&self) -> &[CeremonyReason]
pub fn reasons(&self) -> &[CeremonyReason]
Why one thing here led to another.
pub fn intervention( &self, intervention_id: &CeremonyInterventionId, ) -> Option<&CeremonyIntervention>
pub fn context(&self) -> &CeremonyContext
pub fn idempotency_keys(&self) -> &BTreeSet<IdempotencyKey>
pub fn created_at(&self) -> OffsetDateTime
pub fn updated_at(&self) -> OffsetDateTime
pub fn completed_at(&self) -> Option<OffsetDateTime>
pub fn is_terminal(&self, definition: &CeremonyDefinition) -> bool
pub fn is_completed(&self, definition: &CeremonyDefinition) -> bool
Trait Implementations§
Source§impl Clone for CeremonyInstance
impl Clone for CeremonyInstance
Source§fn clone(&self) -> CeremonyInstance
fn clone(&self) -> CeremonyInstance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more