pub trait LineHandler {
// Required method
fn handle_line(&self, line: &str) -> Result<LoopAction, String>;
}Expand description
Trait for handling lines read by [LineReader].
Implement this to inject command-execution logic into the REPL loop.
§Return values
Ok(LoopAction::Continue)— prompt for the next line.Ok(LoopAction::Break)— exit the loop normally.Err(msg)— print the error and continue.
Required Methods§
fn handle_line(&self, line: &str) -> Result<LoopAction, String>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".