feat: update to songbird 0.6, make joining calls work by spawning everything as required in songbird's documentation
This commit is contained in:
@@ -23,12 +23,12 @@ pub struct State {
|
||||
}
|
||||
|
||||
type Return = ();
|
||||
type BoxedHandler = Box<dyn Fn(State, Interaction) -> BoxFuture<'static, Return>>;
|
||||
type BoxedHandler = Box<dyn Send + Sync + Fn(State, Interaction) -> BoxFuture<'static, Return>>;
|
||||
|
||||
fn box_handler<Handler, Fut>(handler: Handler) -> BoxedHandler
|
||||
where
|
||||
Fut: Future<Output = Return> + Send + 'static,
|
||||
Handler: Fn(State, Interaction) -> Fut + 'static,
|
||||
Handler: Send + Sync + Fn(State, Interaction) -> Fut + 'static,
|
||||
{
|
||||
Box::new(move |state, interaction| Box::pin(handler(state, interaction)))
|
||||
}
|
||||
@@ -50,7 +50,7 @@ impl Router {
|
||||
fn add_route<Fut, Handler>(&mut self, name: &str, handler: Handler)
|
||||
where
|
||||
Fut: Future<Output = Return> + Send + 'static,
|
||||
Handler: Fn(State, Interaction) -> Fut + 'static,
|
||||
Handler: Send + Sync + Fn(State, Interaction) -> Fut + 'static,
|
||||
{
|
||||
self.add_route_already_boxed(name, box_handler(handler));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user