Skip to main content

ParticipantConversation

Struct ParticipantConversation 

Source
pub struct ParticipantConversation { /* private fields */ }
Expand description

Event-sourced participant conversation.

This aggregate is intentionally not Clone: at most one owner may prepare the next event ordinal. Its lifecycle state remains private and has no raw into_parts escape hatch.

use liminal_protocol::lifecycle::ParticipantConversation;

fn require_clone<T: Clone>() {}
require_clone::<ParticipantConversation>();

Implementations§

Source§

impl ParticipantConversation

Source

pub const fn from_genesis(genesis: ConversationGenesis) -> Self

Starts an empty aggregate from immutable genesis configuration.

Source

pub const fn conversation_id(&self) -> ConversationId

Returns this aggregate’s stable conversation identifier.

Source

pub const fn next_event_ordinal(&self) -> u64

Returns the exact ordinal required of the next durable event.

Source

pub const fn genesis_validated(&self) -> bool

Reports whether the one-shot genesis-validation event has committed.

Source

pub const fn decide_genesis_validation(self) -> ConversationDecision

Consumes the aggregate into a durability decision for genesis validation.

A successful decision owns the pre-state inside ConversationCommit, preventing another event from being prepared at the same ordinal while durable append is pending.

Source

pub const fn decide_operation( self, operation: ConversationOperation, ) -> ConversationDecision

Consumes the aggregate into a durability decision for one lifecycle operation.

Every operation payload’s public producer consumes one of the crate’s own sealed commit values (each payload type documents its exact sealed input), so the shell records only operations that actually committed; validated cold restore is the one raw promotion path into those inputs. Every arm carries the conversation named by its producing commit, and a mismatch against this shell’s conversation is refused before any event is selected. A successful decision owns the pre-state inside ConversationCommit exactly as genesis validation does: no state advances until the durable append is confirmed by consuming ConversationCommit::commit.

Source

pub fn replay( self, event: ConversationEvent, ) -> Result<Self, ConversationReplayFailure>

Consumes one decoded durable event into the next replay state.

§Errors

Returns ConversationReplayFailure retaining the unchanged pre-state unless conversation identifier, ordinal, body precondition, and the resulting ordinal all validate before mutation.

Trait Implementations§

Source§

impl Debug for ParticipantConversation

Source§

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

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

impl Eq for ParticipantConversation

Source§

impl PartialEq for ParticipantConversation

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ParticipantConversation

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.