Struct wca::CommandBuilder
source · pub struct CommandBuilder<T> { /* private fields */ }Expand description
A builder struct for constructing commands.
Implementations§
source§impl<T> CommandBuilder<T>
impl<T> CommandBuilder<T>
sourcepub fn with_state(state: T) -> Self
pub fn with_state(state: T) -> Self
Constructs a CommandBuilder with the given state.
source§impl<T: Clone + 'static> CommandBuilder<T>
impl<T: Clone + 'static> CommandBuilder<T>
sourcepub fn command<F, E>(self, command: impl IntoBuilder<F, T>) -> Self
pub fn command<F, E>(self, command: impl IntoBuilder<F, T>) -> Self
Adds a command to the CommandBuilder.
let ca = cui(()) // Add commands using the builder pattern
.command(command)
.command(command2)
.command(echo.arg("string", Type::String)) // Customize your commands by chaining methods such as properties
// property, and arg to add properties and arguments.
.build();
sourcepub fn build(self) -> CommandsAggregator
pub fn build(self) -> CommandsAggregator
Builds and returns a wca::CommandsAggregator instance.
This method finalizes the construction of the CommandBuilder by
creating a wca::CommandsAggregator instance with the accumulated
commands and handlers.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for CommandBuilder<T>
impl<T> !Send for CommandBuilder<T>
impl<T> !Sync for CommandBuilder<T>
impl<T> Unpin for CommandBuilder<T>where
T: Unpin,
impl<T> !UnwindSafe for CommandBuilder<T>
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