Struct wca::CommandsAggregator
source · pub struct CommandsAggregator { /* private fields */ }Expand description
The CommandsAggregator struct is responsible for aggregating all commands that the user defines,
and for parsing and executing them. It is the main entry point of the library.
CommandsAggregator component brings everything together. This component is responsible for configuring the Parser, Grammar, and Executor components based on the user’s needs. It also manages the entire pipeline of processing, from parsing the raw text input to executing the final command(parse -> validate -> execute).
§Example:
use wca::{ CommandsAggregator, Args, Props, Type };
let ca = CommandsAggregator::former()
.command( "echo" )
.hint( "prints all subjects and properties" )
.subject().hint( "argument" ).kind( Type::String ).optional( false ).end()
.property( "property" ).hint( "simple property" ).kind( Type::String ).optional( false ).end()
.routine( | args : Args, props : Props | println!( "= Args\n{args:?}\n\n= Properties\n{props:?}\n" ) )
.end()
.perform();
ca.perform( ".echo something" )?;Implementations§
source§impl CommandsAggregator
impl CommandsAggregator
sourcepub fn former() -> CommandsAggregatorFormer<CommandsAggregator, ReturnContainer>
pub fn former() -> CommandsAggregatorFormer<CommandsAggregator, ReturnContainer>
Make former, variation of builder pattern to form structure defining values of fields step by step.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommandsAggregator
impl !RefUnwindSafe for CommandsAggregator
impl !Send for CommandsAggregator
impl !Sync for CommandsAggregator
impl Unpin for CommandsAggregator
impl !UnwindSafe for CommandsAggregator
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
source§impl<S> SetWithType for S
impl<S> SetWithType for S
source§fn set_with_type<T, IntoT>(&mut self, component: IntoT)where
IntoT: Into<T>,
S: SetComponent<T, IntoT>,
fn set_with_type<T, IntoT>(&mut self, component: IntoT)where
IntoT: Into<T>,
S: SetComponent<T, IntoT>,
Function to set value of a component by its type.