[][src]Struct repl_rs::Repl

pub struct Repl<Context, E: Display> { /* fields omitted */ }

Main REPL struct

Implementations

impl<Context, E: Display> Repl<Context, E>[src]

pub fn new(context: Context) -> Self[src]

Create a new Repl with the given context's initial value.

pub fn with_name(self, name: &str) -> Self[src]

Give your Repl a name. This is used in the help summary for the Repl.

pub fn with_version(self, version: &str) -> Self[src]

Give your Repl a version. This is used in the help summary for the Repl.

pub fn with_description(self, description: &str) -> Self[src]

Give your Repl a description. This is used in the help summary for the Repl.

pub fn with_prompt(self, prompt: &'static dyn Display) -> Self[src]

Give your Repl a custom prompt. The default prompt is the Repl name, followed by a >, all in green, followed by a space.

pub fn with_help_viewer<V: 'static + HelpViewer>(self, help_viewer: V) -> Self[src]

Pass in a custom help viewer

pub fn with_error_handler(
    self,
    handler: fn(error: Error, repl: &Repl<Context, E>) -> Result<()>
) -> Self
[src]

Pass in a custom error handler. This is really only for testing - the default error handler simply prints the error to stderr and then returns

pub fn add_command(self, command: Command<Context, E>) -> Self[src]

Add a command to your REPL

pub fn run(&mut self) -> Result<()>[src]

Auto Trait Implementations

impl<Context, E> !RefUnwindSafe for Repl<Context, E>

impl<Context, E> !Send for Repl<Context, E>

impl<Context, E> !Sync for Repl<Context, E>

impl<Context, E> Unpin for Repl<Context, E> where
    Context: Unpin

impl<Context, E> !UnwindSafe for Repl<Context, E>

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.