Struct pikadick_slash_framework::CommandBuilder
source · 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 Selfwhere
F: Future<Output = Result<(), BoxError>> + Send + 'static,
A: FromOptions + 'static,
pub fn on_process<F, A>( &mut self, on_process: fn(_: Context, _: CommandInteraction, _: A) -> F ) -> &mut Selfwhere F: Future<Output = Result<(), BoxError>> + Send + 'static, A: FromOptions + 'static,
The on_process hook
Trait Implementations§
source§impl Debug for CommandBuilder<'_, '_>
impl Debug for CommandBuilder<'_, '_>
Auto Trait Implementations§
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