fn readline_decorator(mut f: impl FnMut(String)) -> Result<()> {
    let mut rl = Editor::<()>::new();
    loop {
        match rl.readline(">> ") {
            Ok(command) => {
                rl.add_history_entry(command.clone().as_str());
                f(command);
            }
            Err(err) => match err {
                ReadlineError::Interrupted | ReadlineError::Eof => exit(0),
                err => exit(utils::print_error(err)),
            },
        }
    }
}
/* readline_decorator takes in a function, A mutable closure
 * which will perform the sending of data depending on the transport protocol. */
readline_decorator takes in a function, A mutable closure
which will perform the sending of data depending on the transport protocol.
readline_decorator takes in a function A mutable closure which will perform the sending of data depending on the transport protocol .
fn readline_decorator(mut f: impl FnMut(String)) -> Result<()> {
    let mut rl = Editor::<()>::new();
    loop {
        match rl.readline(">> ") {
            Ok(command) => {
                rl.add_history_entry(command.clone().as_str());
                f(command);
            }
            Err(err) => match err {
                ReadlineError::Interrupted | ReadlineError::Eof => exit(0),
                err => exit(utils::print_error(err)),
            },
        }
    }
}
fn readline_decorator ( mut f : impl FnMut ( String ) ) -> Result < ( ) > { let mut rl = Editor :: < ( ) > :: new ( ) ; loop { match rl . readline ( " " ) { Ok ( command ) => { rl . add_history_entry ( command . clone ( ) . as_str ( ) ) ; f ( command ) ; } Err ( err ) => match err { ReadlineError :: Interrupted | ReadlineError :: Eof => exit ( 0 ) , err => exit ( utils :: print_error ( err ) ) , } , } } }
readline_decorator takes in a function, A mutable closure
 which will perform the sending of data depending on the transport protocol.
readline_decorator takes in a function A mutable closure which will perform the sending of data depending on the transport protocol .
f
impl FnMut(String)