Skip to content

Instantly share code, notes, and snippets.

@zgunz42
Created July 19, 2023 13:45
Show Gist options
  • Save zgunz42/38e2db58a09e1c60ce39107df8922f68 to your computer and use it in GitHub Desktop.
Save zgunz42/38e2db58a09e1c60ce39107df8922f68 to your computer and use it in GitHub Desktop.
error[E0277]: the trait bound `fn(teloxide::Bot, teloxide::prelude::Dialogue<State, InMemStorage<State>>, Arc<std::sync::RwLock<context::Context>>, teloxide::prelude::Message) -> impl std::future::Future<Output = Result<(), Box<(dyn StdError + Send + Sync + 'static)>>> {start}: Injectable<_, _, _>` is not satisfied
--> src/chatbot/mod.rs:118:58
|
118 | .branch(dptree::case![State::Start].endpoint(start))
| -------- ^^^^^ the trait `Injectable<_, _, _>` is not implemented for fn item `fn(teloxide::Bot, teloxide::prelude::Dialogue<State, InMemStorage<State>>, Arc<std::sync::RwLock<context::Context>>, teloxide::prelude::Message) -> impl std::future::Future<Output = Result<(), Box<(dyn StdError + Send + Sync + 'static)>>> {start}`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `Injectable<Input, Output, FnArgs>`:
<Asyncify<Func> as Injectable<Input, Output, ()>>
<Asyncify<Func> as Injectable<Input, Output, (A, B)>>
<Asyncify<Func> as Injectable<Input, Output, (A, B, C)>>
<Asyncify<Func> as Injectable<Input, Output, (A, B, C, D)>>
<Asyncify<Func> as Injectable<Input, Output, (A, B, C, D, E)>>
<Asyncify<Func> as Injectable<Input, Output, (A, B, C, D, E, F)>>
<Asyncify<Func> as Injectable<Input, Output, (A, B, C, D, E, F, G)>>
<Asyncify<Func> as Injectable<Input, Output, (A, B, C, D, E, F, G, H)>>
and 2 others
note: required by a bound in `teloxide::dptree::handler::methods::<impl teloxide::prelude::Handler<'a, Input, Output, Descr>>::endpoint`
--> /Users/mac/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dptree-0.3.0/src/handler/methods.rs:108:12
|
108 | F: Injectable<Input, Output, FnArgs> + Send + Sync + 'a,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `teloxide::dptree::handler::methods::<impl Handler<'a, Input, Output, Descr>>::endpoint`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment