[][src]Struct repl_rs::Command

pub struct Command<Context, E> { /* fields omitted */ }

Struct to define a command in the REPL

Implementations

impl<Context, E> Command<Context, E>[src]

pub fn new(name: &str, callback: Callback<Context, E>) -> Self[src]

Create a new command with the given name and callback function

pub fn with_parameter(self, parameter: Parameter) -> Result<Command<Context, E>>[src]

Add a parameter to the command. The order of the parameters is the same as the order in which this is called for each parameter.

pub fn with_help(self, help: &str) -> Command<Context, E>[src]

Add a help summary for the command

Trait Implementations

impl<Context, E> Debug for Command<Context, E>[src]

impl<Context, E> PartialEq<Command<Context, E>> for Command<Context, E>[src]

Auto Trait Implementations

impl<Context, E> RefUnwindSafe for Command<Context, E>

impl<Context, E> Send for Command<Context, E>

impl<Context, E> Sync for Command<Context, E>

impl<Context, E> Unpin for Command<Context, E>

impl<Context, E> UnwindSafe for Command<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.