pub struct Runner { /* private fields */ }Expand description
REPL runner that manages the line-editor and command registry.
The Runner owns a rustyline::Editor configured with a simple
CmdHelper for tab-completion and a Registry of available commands.
Construct a Runner with Runner::new() and call run(state) to read
a single line of input and dispatch the corresponding command.
Implementations§
Source§impl Runner
impl Runner
Sourcepub fn run(&mut self, state: &mut State<'_>) -> Result<()>
pub fn run(&mut self, state: &mut State<'_>) -> Result<()>
Read a single line from the user and dispatch the corresponding command.
§Arguments
state- Mutable reference to the runtimeStatepassed to command handlers.
§Errors
Returns an error when readline operations fail or when command dispatching returns an error.
§Returns
Returns the Result returned by the invoked command handler.
Auto Trait Implementations§
impl Freeze for Runner
impl !RefUnwindSafe for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl UnsafeUnpin for Runner
impl !UnwindSafe for Runner
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