reedline/validator/
mod.rs

1mod default;
2pub use default::DefaultValidator;
3
4/// The syntax validation trait. Implementers of this trait will check to see if the current input
5/// is incomplete and spans multiple lines
6pub trait Validator: Send {
7    /// The action that will handle the current buffer as a line and return the corresponding validation
8    fn validate(&self, line: &str) -> ValidationResult;
9}
10
11#[derive(Clone, Copy)]
12/// Whether or not the validation shows the input was complete
13pub enum ValidationResult {
14    /// An incomplete input which may need to span multiple lines to be complete
15    Incomplete,
16
17    /// An input that is complete as-is
18    Complete,
19}