[−][src]Struct repl_rs::Repl
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]
self,
handler: fn(error: Error, repl: &Repl<Context, E>) -> Result<()>
) -> Self
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,
Context: Unpin,
impl<Context, E> !UnwindSafe for Repl<Context, E>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,