pub struct CommandBuilder<'a, 'b> { /* private fields */ }Expand description
A builder for a Command.
Implementations§
Source§impl<'a, 'b> CommandBuilder<'a, 'b>
impl<'a, 'b> CommandBuilder<'a, 'b>
Sourcepub fn new() -> Self
pub fn new() -> Self
Make a new CommandBuilder.
Sourcepub fn description(&mut self, description: &'b str) -> &mut Self
pub fn description(&mut self, description: &'b str) -> &mut Self
The command description
Sourcepub fn argument(&mut self, argument: ArgumentParam) -> &mut Self
pub fn argument(&mut self, argument: ArgumentParam) -> &mut Self
Add an argument
Sourcepub fn arguments(
&mut self,
arguments: impl Iterator<Item = ArgumentParam>,
) -> &mut Self
pub fn arguments( &mut self, arguments: impl Iterator<Item = ArgumentParam>, ) -> &mut Self
Add many arguments
Sourcepub fn on_process<F, A>(
&mut self,
on_process: fn(Context, CommandInteraction, A) -> F,
) -> &mut Self
pub fn on_process<F, A>( &mut self, on_process: fn(Context, CommandInteraction, A) -> F, ) -> &mut Self
The on_process hook
Trait Implementations§
Source§impl Debug for CommandBuilder<'_, '_>
impl Debug for CommandBuilder<'_, '_>
Auto Trait Implementations§
impl<'a, 'b> Freeze for CommandBuilder<'a, 'b>
impl<'a, 'b> !RefUnwindSafe for CommandBuilder<'a, 'b>
impl<'a, 'b> Send for CommandBuilder<'a, 'b>
impl<'a, 'b> Sync for CommandBuilder<'a, 'b>
impl<'a, 'b> Unpin for CommandBuilder<'a, 'b>
impl<'a, 'b> !UnwindSafe for CommandBuilder<'a, 'b>
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