pub struct Registry { /* private fields */ }Expand description
Command registry describing the available REPL commands and their parameter signatures.
The Registry stores command nodes (concrete commands, subcommand groups
and aliases) in a deterministic BTreeMap so help/usage output is stable.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn completions(&self) -> Vec<String>
pub fn completions(&self) -> Vec<String>
Return a list of concrete command spellings suitable for completion.
Each entry is a space-separated command spelling (including parent subcommands). The results are deduplicated and are intended to be used by the REPL completion helper.
§Returns
A deduplicated Vec<String> containing space-separated command
spellings (including parent subcommands) suitable for use by the
REPL completion helper.
Sourcepub fn usages(&self) -> Vec<String>
pub fn usages(&self) -> Vec<String>
Return human-friendly usage lines for every command.
Each usage entry contains the full command spelling (including parent
subcommands) and the parameter signature (e.g. breakpoint <address>).
This is suitable for printing when the user requests help.
§Returns
A Vec<String> where each entry contains a command spelling and its
parameter signature (for example breakpoint <address>), intended
for help output.
Sourcepub fn run(&self, input: &str, state: &mut State<'_>) -> Result<()>
pub fn run(&self, input: &str, state: &mut State<'_>) -> Result<()>
Parse input and dispatch the corresponding command handler.
§Arguments
input- The raw user input line (e.g.breakpoint 0x400123).state- Mutable reference to runtimeStateused by handlers.
§Errors
Returns an error if dispatching a command fails; handlers return
Result which is propagated to the caller.