pub struct CeremonyReason { /* private fields */ }Expand description
Why one thing a session produced led to another.
Not an annotation on a record: the reason is the edge. A record says what was decided, seen or done, and only the edges say how one came from another — so a session of records alone can be read and not followed, and following is how anyone later works out how and why something was done.
Immutable, and not corrected. Changing your mind is asserting another reason that supersedes this one, which keeps what was believed at the time — the thing a later reader asking “what did we think then” cannot do without.
Implementations§
Source§impl CeremonyReason
impl CeremonyReason
Sourcepub fn new(
from: CeremonyRecordRef,
to: CeremonyRecordRef,
kind: CeremonyReasonKind,
why: impl Into<String>,
confidence: MemoryConfidence,
asserted_by: Option<RoleId>,
asserted_at: OffsetDateTime,
) -> Result<Self, DomainError>
pub fn new( from: CeremonyRecordRef, to: CeremonyRecordRef, kind: CeremonyReasonKind, why: impl Into<String>, confidence: MemoryConfidence, asserted_by: Option<RoleId>, asserted_at: OffsetDateTime, ) -> Result<Self, DomainError>
State that from came about from to, and why.
asserted_by is absent only for what the engine itself
observed. Every other kind requires a seat, and which kinds
those are is not this constructor’s to police — the session
holds the definition and the records, and checks it there.
pub fn from(&self) -> &CeremonyRecordRef
pub fn to(&self) -> &CeremonyRecordRef
pub const fn kind(&self) -> CeremonyReasonKind
pub const fn confidence(&self) -> MemoryConfidence
Sourcepub fn asserted_by(&self) -> Option<&RoleId>
pub fn asserted_by(&self) -> Option<&RoleId>
The seat that said so, where a seat did.