pub enum ConversationEvent {
MessageReceived {
message_id: String,
received_at: u64,
},
ProcessingStarted {
message_id: String,
},
StepCompleted {
message_id: String,
step_index: u32,
output: Vec<u8>,
},
ProcessingFinished {
message_id: String,
},
ErrorOccurred {
message_id: String,
error: String,
},
}Expand description
Event-sourced durable conversation state transition.
Variants§
MessageReceived
A message entered the conversation.
Fields
ProcessingStarted
Processing started for a received message.
StepCompleted
One processing step completed successfully.
Fields
ProcessingFinished
Processing finished for a message.
ErrorOccurred
Processing failed for a message.
Implementations§
Source§impl ConversationEvent
impl ConversationEvent
Sourcepub fn serialize(&self) -> Result<Vec<u8>, DurabilityError>
pub fn serialize(&self) -> Result<Vec<u8>, DurabilityError>
Serializes this event into deterministic storage bytes.
§Errors
Returns DurabilityError::EnvelopeError when a field length cannot be encoded.
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self, DurabilityError>
pub fn deserialize(bytes: &[u8]) -> Result<Self, DurabilityError>
Deserializes an event previously produced by Self::serialize.
§Errors
Returns DurabilityError::EnvelopeError when bytes are malformed,
truncated, contain invalid UTF-8, use an unknown tag, or carry trailing data.
Source§impl ConversationEvent
impl ConversationEvent
Sourcepub fn message_id(&self) -> &str
pub fn message_id(&self) -> &str
Returns the message identifier carried by every event variant.
Trait Implementations§
Source§impl Clone for ConversationEvent
impl Clone for ConversationEvent
Source§fn clone(&self) -> ConversationEvent
fn clone(&self) -> ConversationEvent
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 ConversationEvent
impl Debug for ConversationEvent
impl Eq for ConversationEvent
Source§impl PartialEq for ConversationEvent
impl PartialEq for ConversationEvent
Source§fn eq(&self, other: &ConversationEvent) -> bool
fn eq(&self, other: &ConversationEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ConversationEvent
Auto Trait Implementations§
impl Freeze for ConversationEvent
impl RefUnwindSafe for ConversationEvent
impl Send for ConversationEvent
impl Sync for ConversationEvent
impl Unpin for ConversationEvent
impl UnsafeUnpin for ConversationEvent
impl UnwindSafe for ConversationEvent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.