diff options
| author | Zeyla Hellyer <[email protected]> | 2017-09-18 20:28:14 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-09-18 20:28:14 -0700 |
| commit | 50d7f00f1b01f4e0d9c86dbdd05a4d4f7b41f8b1 (patch) | |
| tree | 353e42d9be0b4fd4bd86141490109970c32dd651 /src/framework/standard/mod.rs | |
| parent | Fix block on spawning multiple shards (diff) | |
| download | serenity-50d7f00f1b01f4e0d9c86dbdd05a4d4f7b41f8b1.tar.xz serenity-50d7f00f1b01f4e0d9c86dbdd05a4d4f7b41f8b1.zip | |
Add Send/Sync to framework items
Diffstat (limited to 'src/framework/standard/mod.rs')
| -rw-r--r-- | src/framework/standard/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index 4e145e0..8a00691 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -139,7 +139,7 @@ pub enum DispatchError { WebhookAuthor, } -type DispatchErrorHook = Fn(Context, Message, DispatchError) + 'static; +type DispatchErrorHook = Fn(Context, Message, DispatchError) + Send + Sync + 'static; /// A utility for easily managing dispatches to commands. /// @@ -290,7 +290,7 @@ impl StandardFramework { limit: i32, check: Check) -> Self - where Check: Fn(&mut Context, Option<GuildId>, ChannelId, UserId) -> bool + 'static, + where Check: Fn(&mut Context, Option<GuildId>, ChannelId, UserId) -> bool + Send + Sync + 'static, S: Into<String> { self.buckets.insert( s.into(), @@ -341,7 +341,7 @@ impl StandardFramework { limit: i32, check: Check) -> Self - where Check: Fn(&mut Context, ChannelId, UserId) -> bool + 'static, S: Into<String> { + where Check: Fn(&mut Context, ChannelId, UserId) -> bool + Send + Sync + 'static, S: Into<String> { self.buckets.insert( s.into(), Bucket { @@ -594,7 +594,7 @@ impl StandardFramework { /// # } /// ``` pub fn on<F, S>(mut self, command_name: S, f: F) -> Self - where F: Fn(&mut Context, &Message, Args) -> Result<(), String> + 'static, S: Into<String> { + where F: Fn(&mut Context, &Message, Args) -> Result<(), String> + Send + Sync + 'static, S: Into<String> { { let ungrouped = self.groups .entry("Ungrouped".to_owned()) @@ -731,7 +731,7 @@ impl StandardFramework { /// })); /// ``` pub fn on_dispatch_error<F>(mut self, f: F) -> Self - where F: Fn(Context, Message, DispatchError) + 'static { + where F: Fn(Context, Message, DispatchError) + Send + Sync + 'static { self.dispatch_error_handler = Some(Arc::new(f)); self @@ -787,7 +787,7 @@ impl StandardFramework { /// ``` /// pub fn before<F>(mut self, f: F) -> Self - where F: Fn(&mut Context, &Message, &str) -> bool + 'static { + where F: Fn(&mut Context, &Message, &str) -> bool + Send + Sync + 'static { self.before = Some(Arc::new(f)); self @@ -818,7 +818,7 @@ impl StandardFramework { /// })); /// ``` pub fn after<F>(mut self, f: F) -> Self - where F: Fn(&mut Context, &Message, &str, Result<(), String>) + 'static { + where F: Fn(&mut Context, &Message, &str, Result<(), String>) + Send + Sync + 'static { self.after = Some(Arc::new(f)); self |