pub struct Console { /* private fields */ }Expand description
The console kernel: a registry of commands and the dispatcher for them.
Implementations§
Source§impl Console
impl Console
Sourcepub fn register_arc(self, command: Arc<dyn Command>) -> Self
pub fn register_arc(self, command: Arc<dyn Command>) -> Self
Register an already-shared command.
Sourcepub async fn run(&self, app: &Application, args: Arguments) -> i32
pub async fn run(&self, app: &Application, args: Arguments) -> i32
Run the command named in args, returning its exit code.
Never panics and never propagates: a console’s job is to report and
exit with a code, so an error becomes a message on stderr and
exit::FAILURE.
Sourcepub async fn run_argv<I, S>(&self, app: &Application, argv: I) -> i32
pub async fn run_argv<I, S>(&self, app: &Application, argv: I) -> i32
Parse argv (without the program name) and run it.
Sourcepub async fn run_from_env(&self, app: &Application) -> i32
pub async fn run_from_env(&self, app: &Application) -> i32
Parse the process’s own arguments and run.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Console
impl !UnwindSafe for Console
impl Freeze for Console
impl Send for Console
impl Sync for Console
impl Unpin for Console
impl UnsafeUnpin for Console
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