pub struct LazyModuleGroup { /* private fields */ }Expand description
Lazy command registry: builds module subcommands on-demand from the apcore Registry, caching them after first construction.
This is the Rust equivalent of the Python LazyModuleGroup (Click group
subclass with lazy get_command / list_commands).
Implementations§
Source§impl LazyModuleGroup
impl LazyModuleGroup
Sourcepub fn new(
registry: Arc<dyn RegistryProvider>,
executor: Arc<dyn ModuleExecutor>,
) -> Self
pub fn new( registry: Arc<dyn RegistryProvider>, executor: Arc<dyn ModuleExecutor>, ) -> Self
Create a new lazy module group.
§Arguments
registry— module registry (real or mock)executor— module executor (real or mock)
Sourcepub fn list_commands(&self) -> Vec<String>
pub fn list_commands(&self) -> Vec<String>
Return sorted list of all command names: built-ins + module ids.
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 None if the name is not a builtin
and is not found in the registry.
For module commands, builds and caches a lightweight clap Command.
Auto Trait Implementations§
impl Freeze for LazyModuleGroup
impl !RefUnwindSafe for LazyModuleGroup
impl Send for LazyModuleGroup
impl Sync for LazyModuleGroup
impl Unpin for LazyModuleGroup
impl UnsafeUnpin for LazyModuleGroup
impl !UnwindSafe for LazyModuleGroup
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