pub struct StateMachine<'a, S, E = ConversationEffect> { /* private fields */ }Implementations§
Source§impl<'a, S, E> StateMachine<'a, S, E>
impl<'a, S, E> StateMachine<'a, S, E>
pub fn new(steps: Vec<Step<'a, S, E>>, cancel: CancellationToken) -> Self
pub async fn step(&self, session: &S, emit: &Emitter) -> Result<StepResult<E>>
pub async fn apply<R>(
&self,
runtime: &R,
session: &S,
effects: &mut [E],
emit: &Emitter,
) -> Result<()>where
R: EffectHandler<S, E>,
pub async fn run<R>(
&self,
runtime: &R,
session_id: &str,
emit: &Emitter,
) -> Result<S>where
R: SessionLoader<S> + EffectHandler<S, E>,
pub async fn finalize<R>(
&self,
runtime: &R,
session_id: &str,
emit: &Emitter,
) -> Result<S>where
R: SessionLoader<S> + EffectHandler<S, E>,
Auto Trait Implementations§
impl<'a, S, E = ConversationEffect> !Freeze for StateMachine<'a, S, E>
impl<'a, S, E = ConversationEffect> !RefUnwindSafe for StateMachine<'a, S, E>
impl<'a, S, E = ConversationEffect> !UnwindSafe for StateMachine<'a, S, E>
impl<'a, S, E> Send for StateMachine<'a, S, E>
impl<'a, S, E> Sync for StateMachine<'a, S, E>
impl<'a, S, E> Unpin for StateMachine<'a, S, E>
impl<'a, S, E> UnsafeUnpin for StateMachine<'a, S, E>
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> 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> 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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.