pub struct MemoryProvenance { /* private fields */ }Expand description
Who says so, and when they saw it.
Memory without provenance is hearsay: an agent reading it later cannot weigh a claim it cannot attribute. The session is carried too, so a memory found from somewhere else can be walked back to the working session that produced it.
Implementations§
Source§impl MemoryProvenance
impl MemoryProvenance
pub fn new( ceremony_id: CeremonyId, role_id: Option<RoleId>, observed_at: OffsetDateTime, ) -> Self
pub fn ceremony_id(&self) -> &CeremonyId
Sourcepub fn role_id(&self) -> Option<&RoleId>
pub fn role_id(&self) -> Option<&RoleId>
The role that saw it, when a role did. Absent for what the engine itself observed — a transition firing has no author.
pub fn observed_at(&self) -> OffsetDateTime
Sourcepub fn idempotency_key(
&self,
discriminator: &str,
) -> Result<String, DomainError>
pub fn idempotency_key( &self, discriminator: &str, ) -> Result<String, DomainError>
An idempotency key that names the write rather than the moment.
Retrying a write must not double it, and the only durable way to say “this is that same write again” is to derive the key from what is being written about. Wall-clock time would make every retry a new memory.
Trait Implementations§
Source§impl Clone for MemoryProvenance
impl Clone for MemoryProvenance
Source§impl Debug for MemoryProvenance
impl Debug for MemoryProvenance
Source§impl<'de> Deserialize<'de> for MemoryProvenance
impl<'de> Deserialize<'de> for MemoryProvenance
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 MemoryProvenance
Source§impl PartialEq for MemoryProvenance
impl PartialEq for MemoryProvenance
Source§impl Serialize for MemoryProvenance
impl Serialize for MemoryProvenance
impl StructuralPartialEq for MemoryProvenance
Auto Trait Implementations§
impl Freeze for MemoryProvenance
impl RefUnwindSafe for MemoryProvenance
impl Send for MemoryProvenance
impl Sync for MemoryProvenance
impl Unpin for MemoryProvenance
impl UnsafeUnpin for MemoryProvenance
impl UnwindSafe for MemoryProvenance
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