pub struct Interaction {
pub id: InteractionId,
pub thread_id: ThreadId,
pub state: InteractionState,
pub task_ids: Vec<TaskId>,
pub started_at: DateTime<Utc>,
pub ended_at: Option<DateTime<Utc>>,
}Expand description
Interaction - a single trigger → response attempt
Fields§
§id: InteractionIdUnique identifier
thread_id: ThreadIdThread this interaction belongs to
state: InteractionStateCurrent state
task_ids: Vec<TaskId>Task IDs associated with this interaction
started_at: DateTime<Utc>Start timestamp
ended_at: Option<DateTime<Utc>>End timestamp (if completed)
Implementations§
Source§impl Interaction
impl Interaction
Sourcepub fn with_id(
id: impl Into<InteractionId>,
thread_id: impl Into<ThreadId>,
) -> Self
pub fn with_id( id: impl Into<InteractionId>, thread_id: impl Into<ThreadId>, ) -> Self
Create a new interaction with specific ID
Sourcepub fn set_state(&mut self, state: InteractionState)
pub fn set_state(&mut self, state: InteractionState)
Set the interaction state
Sourcepub fn wait_for_user(&mut self)
pub fn wait_for_user(&mut self)
Mark the interaction as waiting for user
Sourcepub fn wait_for_event(&mut self)
pub fn wait_for_event(&mut self)
Mark the interaction as waiting for event
Trait Implementations§
Source§impl Clone for Interaction
impl Clone for Interaction
Source§fn clone(&self) -> Interaction
fn clone(&self) -> Interaction
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 Interaction
impl Debug for Interaction
Source§impl<'de> Deserialize<'de> for Interaction
impl<'de> Deserialize<'de> for Interaction
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
Auto Trait Implementations§
impl Freeze for Interaction
impl RefUnwindSafe for Interaction
impl Send for Interaction
impl Sync for Interaction
impl Unpin for Interaction
impl UnsafeUnpin for Interaction
impl UnwindSafe for Interaction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more