Skip to main content

Registry

Struct Registry 

Source
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

Source

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.

Source

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.

Source

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 runtime State used by handlers.
§Errors

Returns an error if dispatching a command fails; handlers return Result which is propagated to the caller.

Trait Implementations§

Source§

impl Default for Registry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.