Skip to main content

CeremonyInstance

Struct CeremonyInstance 

Source
pub struct CeremonyInstance { /* private fields */ }

Implementations§

Source§

impl CeremonyInstance

Source

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.

Source

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

Source

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>

Source

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>

Source

pub fn respond_to_intervention_as( &mut self, definition: &CeremonyDefinition, intervention_id: &CeremonyInterventionId, role_id: RoleId, content: CeremonyInterventionContent, now: OffsetDateTime, ) -> Result<(), DomainError>

Source

pub fn prepare_evidence_request_as( &self, definition: &CeremonyDefinition, intervention_id: CeremonyInterventionId, role_id: RoleId, source_id: CeremonyEvidenceSourceId, query: CeremonyInterventionContent, ) -> Result<CeremonyEvidenceRequest, DomainError>

Source

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>

Source

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.
Source

pub fn close_intervention_as( &mut self, definition: &CeremonyDefinition, intervention_id: &CeremonyInterventionId, role_id: &RoleId, now: OffsetDateTime, ) -> Result<(), DomainError>

Source§

impl CeremonyInstance

Source

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.

Source

pub fn participant_bindings( &self, ) -> &BTreeMap<RoleId, CeremonyParticipantBinding>

Source

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

Source

pub fn start_step_as( &mut self, definition: &CeremonyDefinition, role_id: &RoleId, step_id: &StepId, lease: StepLease, now: OffsetDateTime, ) -> Result<StepAttempt, DomainError>

Source

pub fn start_step( &mut self, definition: &CeremonyDefinition, step_id: &StepId, lease: StepLease, now: OffsetDateTime, ) -> Result<StepAttempt, DomainError>

Source

pub fn apply_step_result( &mut self, definition: &CeremonyDefinition, step_id: &StepId, result: StepResult, now: OffsetDateTime, ) -> Result<(), DomainError>

Source§

impl CeremonyInstance

Source

pub fn apply_transition_as( &mut self, definition: &CeremonyDefinition, role_id: &RoleId, trigger: &TransitionTrigger, now: OffsetDateTime, ) -> Result<StateId, DomainError>

Source

pub fn apply_transition( &mut self, definition: &CeremonyDefinition, trigger: &TransitionTrigger, now: OffsetDateTime, ) -> Result<StateId, DomainError>

Source§

impl CeremonyInstance

Source

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.

Source

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.

Source

pub fn bound_definition(&self) -> Option<CeremonyDefinitionDigest>

The digest of the published definition this instance runs, if it was started from one.

Source

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.

Source

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.

Source

pub fn id(&self) -> &CeremonyId

Source

pub fn definition_name(&self) -> &CeremonyName

Source

pub fn definition_version(&self) -> &CeremonyVersion

Source

pub fn current_state(&self) -> &StateId

Source

pub fn step_records(&self) -> &BTreeMap<StepId, StepExecutionRecord>

Source

pub fn step_record(&self, step_id: &StepId) -> Option<&StepExecutionRecord>

Source

pub fn step_record_history(&self, step_id: &StepId) -> &[StepExecutionRecord]

Finished iterations before the current record, in execution order.

Source

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.

Source

pub fn interventions(&self) -> &[CeremonyIntervention]

Source

pub fn guard_deferrals(&self) -> &[CeremonyGuardDeferral]

Source

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.

Source

pub fn transitions(&self) -> &[CeremonyTransitionRecord]

Every move this session made, in the order it made them.

Source

pub fn reasons(&self) -> &[CeremonyReason]

Why one thing here led to another.

Source

pub fn intervention( &self, intervention_id: &CeremonyInterventionId, ) -> Option<&CeremonyIntervention>

Source

pub fn context(&self) -> &CeremonyContext

Source

pub fn idempotency_keys(&self) -> &BTreeSet<IdempotencyKey>

Source

pub fn created_at(&self) -> OffsetDateTime

Source

pub fn updated_at(&self) -> OffsetDateTime

Source

pub fn completed_at(&self) -> Option<OffsetDateTime>

Source

pub fn is_terminal(&self, definition: &CeremonyDefinition) -> bool

Source

pub fn is_completed(&self, definition: &CeremonyDefinition) -> bool

Trait Implementations§

Source§

impl Clone for CeremonyInstance

Source§

fn clone(&self) -> CeremonyInstance

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CeremonyInstance

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CeremonyInstance

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for CeremonyInstance

Source§

impl PartialEq for CeremonyInstance

Source§

fn eq(&self, other: &CeremonyInstance) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for CeremonyInstance

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CeremonyInstance

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.