Type Aux; -> Transition
@@ -6,11 +6,13 @@ use crate::{
use futures::future::BoxFuture;
/// Represents a transition function of a dialogue FSM.
-pub trait Transition<T>: Sized {
+pub trait Transition: Sized {
+ type Aux;
+
/// Turns itself into another state, depending on the input message.
///
/// `aux` will be passed to each subtransition function.
- fn react(self, cx: TransitionIn, aux: T) -> BoxFuture<'static, TransitionOut<Self>>;
+ fn react(self, cx: TransitionIn, aux: Self::Aux) -> BoxFuture<'static, TransitionOut<Self>>;
}
/// Like [`Transition`], but from `StateN` -> `Dialogue`.
@@ -18,14 +20,14 @@ pub trait Transition<T>: Sized {
/// [`Transition`]: crate::dispatching::dialogue::Transition
pub trait SubTransition
where
- Self::Dialogue: Transition<Self::Aux>,
+ Self::Dialogue: Transition<Aux = Self::Aux>,
{
type Aux;
type Dialogue;
/// Turns itself into another state, depending on the input message.
///
- /// `aux` is something that is provided by the call side, for example, a
+ /// `aux` is something that is provided by the call side, for example,
/// message's text.
fn react(
self,
