Struct jdn_cli::manager::CliManager[][src]

pub struct CliManager<R: BufRead, W: Write> { /* fields omitted */ }

A manager responsible for handling command line input and output.

Implementations

impl CliManager<BufReader<Stdin>, Stdout>[src]

pub fn new() -> Self[src]

Constructs a new CliManager.

impl<R: BufRead, W: 'static + Write> CliManager<R, W>[src]

pub fn with_reader_writer(reader: R, writer: W) -> CliManager<R, W>[src]

Constructs a new CliManager with the given read/write streams.

pub fn start(&mut self)[src]

Starts the command line interface. Note that this is a blocking operation; once this function returns, the user has submitted a request to stop the application (EXIT).

pub fn add_handler(&mut self, handler: Arc<dyn CliHandler>)[src]

Adds the given CliHandler. All commands returned by CliHandler::get_commands() will now be forwarded to this handler.

Arguments

handler - A reference to the handler to add. This reference is cloned for retention by the manager.

Trait Implementations

impl Default for CliManager<BufReader<Stdin>, Stdout>[src]

Auto Trait Implementations

impl<R, W> !RefUnwindSafe for CliManager<R, W>

impl<R, W> !Send for CliManager<R, W>

impl<R, W> !Sync for CliManager<R, W>

impl<R, W> Unpin for CliManager<R, W> where
    R: Unpin,
    W: Unpin

impl<R, W> !UnwindSafe for CliManager<R, W>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.