Struct terminal_cli::CliLineMatcher
[−]
[src]
pub struct CliLineMatcher<'a> { /* fields omitted */ }
Match commands against the given input line
Methods
impl<'a> CliLineMatcher<'a>
[src]
fn new(line: &'a str, mode: LineMatcherMode) -> CliLineMatcher<'a>
[src]
Create a new line matcher
fn get_mode(&self) -> LineMatcherMode
[src]
fn set_line_prefix(&mut self, prefix: String)
[src]
fn get_state(&self) -> &LineBufferResult
[src]
fn starts_with(&self, cmd: &str) -> bool
[src]
fn add_unmatched_prefix(&mut self, prefix: &str)
[src]
fn match_cmd<'b>(&mut self, cmd: &'b CliCommand<'b>) -> LineMatcherProgress
[src]
Match the command, mutates the internal state of the matching
fn match_cmd_str<'b>(
&mut self,
cmd: &'b str,
prefix: Option<&'b str>
) -> LineMatcherProgress
[src]
&mut self,
cmd: &'b str,
prefix: Option<&'b str>
) -> LineMatcherProgress
Match the string, mutates the internal state
fn finish(self) -> LineBufferResult
[src]
Finish with the line matching, consume the matcher