Trait Handler

Source
pub trait Handler<A, T> {
    // Required method
    fn handle(&self, args: A, context: &mut T) -> ShellResult;
}

Required Methods§

Source

fn handle(&self, args: A, context: &mut T) -> ShellResult

Implementors§

Source§

impl<A, T, F> Handler<A, T> for F
where F: Fn(A, &mut T) -> ShellResult,

A handler that takes a parser and a context and returns a ShellResult This is a convenience implementation for closures It allows you to pass a closure that takes a parser and a context and returns a ShellResult as a handler to the Shell struct