aboutsummaryrefslogtreecommitdiff
path: root/src/framework/standard/command.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-09-18 20:28:14 -0700
committerZeyla Hellyer <[email protected]>2017-09-18 20:28:14 -0700
commit50d7f00f1b01f4e0d9c86dbdd05a4d4f7b41f8b1 (patch)
tree353e42d9be0b4fd4bd86141490109970c32dd651 /src/framework/standard/command.rs
parentFix block on spawning multiple shards (diff)
downloadserenity-50d7f00f1b01f4e0d9c86dbdd05a4d4f7b41f8b1.tar.xz
serenity-50d7f00f1b01f4e0d9c86dbdd05a4d4f7b41f8b1.zip
Add Send/Sync to framework items
Diffstat (limited to 'src/framework/standard/command.rs')
-rw-r--r--src/framework/standard/command.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/framework/standard/command.rs b/src/framework/standard/command.rs
index e9bdd52..66b6490 100644
--- a/src/framework/standard/command.rs
+++ b/src/framework/standard/command.rs
@@ -4,15 +4,15 @@ use client::Context;
use model::{Message, Permissions};
use std::collections::HashMap;
-pub type Check = Fn(&mut Context, &Message, &mut Args, &Arc<Command>) -> bool + 'static;
-pub type Exec = Fn(&mut Context, &Message, Args) -> Result<(), String> + 'static;
+pub type Check = Fn(&mut Context, &Message, &mut Args, &Arc<Command>) -> bool + Send + Sync + 'static;
+pub type Exec = Fn(&mut Context, &Message, Args) -> Result<(), String> + Send + Sync + 'static;
pub type Help = Fn(&mut Context, &Message, HashMap<String, Arc<CommandGroup>>, Args)
-> Result<(), String>
- + 'static;
-pub type BeforeHook = Fn(&mut Context, &Message, &str) -> bool + 'static;
-pub type AfterHook = Fn(&mut Context, &Message, &str, Result<(), String>) + 'static;
+ + Send + Sync + 'static;
+pub type BeforeHook = Fn(&mut Context, &Message, &str) -> bool + Send + Sync + 'static;
+pub type AfterHook = Fn(&mut Context, &Message, &str, Result<(), String>) + Send + Sync + 'static;
pub(crate) type InternalCommand = Arc<Command>;
-pub type PrefixCheck = Fn(&mut Context, &Message) -> Option<String> + 'static;
+pub type PrefixCheck = Fn(&mut Context, &Message) -> Option<String> + Send + Sync + 'static;
pub enum CommandOrAlias {
Alias(String),
@@ -76,7 +76,7 @@ pub struct Command {
impl Command {
pub fn new<F>(f: F) -> Self
- where F: Fn(&mut Context, &Message, Args) -> Result<(), String> + 'static {
+ where F: Fn(&mut Context, &Message, Args) -> Result<(), String> + Send + Sync + 'static {
Command {
aliases: Vec::new(),
checks: Vec::default(),