pub struct GroupedModuleGroup { /* private fields */ }Expand description
Grouped command registry: organises modules into sub-command groups derived from dotted module IDs or explicit display overlay metadata.
This is the Rust equivalent of the Python GroupedModuleGroup.
Implementations§
Source§impl GroupedModuleGroup
impl GroupedModuleGroup
Sourcepub fn new(
registry: Arc<dyn RegistryProvider>,
executor: Arc<dyn ModuleExecutor>,
help_text_max_length: usize,
) -> Self
pub fn new( registry: Arc<dyn RegistryProvider>, executor: Arc<dyn ModuleExecutor>, help_text_max_length: usize, ) -> Self
Create a new grouped module group.
Sourcepub fn resolve_group(
module_id: &str,
descriptor: &Value,
) -> (Option<String>, String)
pub fn resolve_group( module_id: &str, descriptor: &Value, ) -> (Option<String>, String)
Resolve the group and command name for a module.
Returns (Some(group), command) for grouped modules or
(None, command) for top-level modules.
Sourcepub fn build_group_map(&mut self)
pub fn build_group_map(&mut self)
Build the internal group map from registry modules.
Sourcepub fn list_commands(&mut self) -> Vec<String>
pub fn list_commands(&mut self) -> Vec<String>
Return sorted list of all command names: builtins + groups + top-level modules.
Sourcepub fn get_command(&mut self, name: &str) -> Option<Command>
pub fn get_command(&mut self, name: &str) -> Option<Command>
Look up a command by name. Returns a clap Command for a group (with subcommands) or a top-level module, or None.
Auto Trait Implementations§
impl Freeze for GroupedModuleGroup
impl !RefUnwindSafe for GroupedModuleGroup
impl Send for GroupedModuleGroup
impl Sync for GroupedModuleGroup
impl Unpin for GroupedModuleGroup
impl UnsafeUnpin for GroupedModuleGroup
impl !UnwindSafe for GroupedModuleGroup
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