pub struct Command;Expand description
A unified API to build commands.
This type’s associated functions initialize specialized command types depending on what type is being initialized. This type does not represent a command directly.
Implementations§
Source§impl Command
impl Command
Sourcepub fn prefixed<State, F, Args>(
name: impl Into<String>,
handler: F,
) -> PrefixedCommandBuilder<State>where
F: PrefixedCommandHandler<State, Args> + 'static,
Args: Send + Sync + 'static,
State: StateBound,
pub fn prefixed<State, F, Args>(
name: impl Into<String>,
handler: F,
) -> PrefixedCommandBuilder<State>where
F: PrefixedCommandHandler<State, Args> + 'static,
Args: Send + Sync + 'static,
State: StateBound,
Creates a new prefixed command builder with the given name and handler.
Arguments:
name- The command’s name, used to invoke the command.handler- The command’s handler, the function that executes when the command is run.
Returns:
PrefixedCommandBuilder - A new command builder with the given name and handler.
Sourcepub fn slash<State, F, Args>(
name: impl Into<String>,
handler: F,
) -> SlashCommandBuilder<State>where
F: SlashCommandHandler<State, Args> + 'static,
State: StateBound,
Args: Send + Sync + 'static,
pub fn slash<State, F, Args>(
name: impl Into<String>,
handler: F,
) -> SlashCommandBuilder<State>where
F: SlashCommandHandler<State, Args> + 'static,
State: StateBound,
Args: Send + Sync + 'static,
Creates a new slash command builder with the given name and handler.
Arguments:
name- The command’s name, used to invoke the command.handler- The command’s handler, the function that executes when the command is run.
Returns:
SlashCommandBuilder - A new slash command builder with the given name.
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more