mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Add <E> type parameter to TransitionIn
This commit is contained in:
parent
b0fcb6c847
commit
d2f4194d80
3 changed files with 4 additions and 5 deletions
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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>>;
|
||||
|
|
Loading…
Add table
Reference in a new issue