pub struct AuditRecord { /* private fields */ }Expand description
One fact in a ceremony’s audit journal.
Immutable by construction: the digest is computed once, from the content and the previous record’s digest, and every accessor is read-only. There is no setter that could leave the digest stale.
Implementations§
Source§impl AuditRecord
impl AuditRecord
Sourcepub fn first(fact: AuditFact) -> Result<Self, DomainError>
pub fn first(fact: AuditFact) -> Result<Self, DomainError>
Seal a fact as the first record of a ceremony’s journal.
Sourcepub fn following(fact: AuditFact, previous: &Self) -> Result<Self, DomainError>
pub fn following(fact: AuditFact, previous: &Self) -> Result<Self, DomainError>
Seal a fact as the record that follows previous.
The successor’s position and previous digest are taken from the predecessor rather than supplied, so a caller cannot append a record that claims to follow something it does not.
pub fn event_id(&self) -> &EventId
pub fn event_type(&self) -> AuditEventType
pub fn schema_version(&self) -> u32
pub fn ceremony_id(&self) -> &CeremonyId
pub fn definition_name(&self) -> &CeremonyName
pub fn definition_version(&self) -> &CeremonyVersion
pub fn sequence(&self) -> AuditSequence
pub fn occurred_at(&self) -> OffsetDateTime
pub fn actor(&self) -> &AuditActor
pub fn correlation_id(&self) -> Option<&EventId>
pub fn causation_id(&self) -> Option<&EventId>
pub fn trace_id(&self) -> Option<&str>
pub fn previous_record_hash(&self) -> Option<AuditRecordHash>
pub fn record_hash(&self) -> AuditRecordHash
Sourcepub fn digest_is_intact(&self) -> Result<bool, DomainError>
pub fn digest_is_intact(&self) -> Result<bool, DomainError>
Whether the digest still matches the content.
A record that fails this was altered after it was sealed, or was never sealed by this implementation.
Trait Implementations§
Source§impl Clone for AuditRecord
impl Clone for AuditRecord
Source§fn clone(&self) -> AuditRecord
fn clone(&self) -> AuditRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuditRecord
impl Debug for AuditRecord
Source§impl<'de> Deserialize<'de> for AuditRecord
impl<'de> Deserialize<'de> for AuditRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AuditRecord
Source§impl PartialEq for AuditRecord
impl PartialEq for AuditRecord
Source§impl Serialize for AuditRecord
impl Serialize for AuditRecord
impl StructuralPartialEq for AuditRecord
Auto Trait Implementations§
impl Freeze for AuditRecord
impl RefUnwindSafe for AuditRecord
impl Send for AuditRecord
impl Sync for AuditRecord
impl Unpin for AuditRecord
impl UnsafeUnpin for AuditRecord
impl UnwindSafe for AuditRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more