Add <E> type parameter to TransitionIn

This commit is contained in:
Temirkhan Myrzamadi 2020-05-26 17:20:57 +06:00
parent b0fcb6c847
commit d2f4194d80
3 changed files with 4 additions and 5 deletions

View file

@ -251,7 +251,7 @@ wrap_dialogue!(
```rust
// Imports are omitted...
pub type In<State> = TransitionIn<State>;
pub type In<State> = TransitionIn<State, std::convert::Infallible>;
pub type Out = TransitionOut<Wrapper>;
pub async fn start(cx: In<StartState>) -> Out {

View file

@ -2,7 +2,7 @@ use teloxide::prelude::*;
use super::{favourite_music::FavouriteMusic, states::*};
pub type In<State> = TransitionIn<State>;
pub type In<State> = TransitionIn<State, std::convert::Infallible>;
pub type Out = TransitionOut<Wrapper>;
pub async fn start(cx: In<StartState>) -> Out {

View file

@ -79,7 +79,7 @@ pub use storage::{InMemStorage, Storage};
/// default Self(Dialogue::inject(StartState)),
/// );
///
/// pub type In<State> = TransitionIn<State>;
/// pub type In<State> = TransitionIn<State, std::convert::Infallible>;
/// pub type Out = TransitionOut<Wrapper>;
///
/// pub async fn start(cx: In<StartState>) -> Out { todo!() }
@ -224,8 +224,7 @@ macro_rules! up {
}
/// A type passed into a FSM transition function.
pub type TransitionIn<State> =
DialogueWithCx<Message, State, std::convert::Infallible>;
pub type TransitionIn<State, E> = DialogueWithCx<Message, State, E>;
// A type returned from a FSM transition function.
pub type TransitionOut<DWrapper> = ResponseResult<DialogueStage<DWrapper>>;