pub trait CommandExt<I>: Sized {
// Provided method
fn with_command<S: Into<String>>(
self,
name: S,
) -> Predicate<CommandPredicate, Command, Self, I> { ... }
}
Expand description
Provides a shortcut for wrapping a Handler
by a CommandPredicate
.
Provided Methods§
Sourcefn with_command<S: Into<String>>(
self,
name: S,
) -> Predicate<CommandPredicate, Command, Self, I>
fn with_command<S: Into<String>>( self, name: S, ) -> Predicate<CommandPredicate, Command, Self, I>
Shortcut to create a command handler.
Example: handler.command("/name")
.
§Arguments
name
- A name of a command with leading/
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.