[−][src]Struct xcli::PrefixCompleter
A PrefixCompleter
for subcommands
Implementations
impl PrefixCompleter
[src]
pub fn new(cmd_tree: &Command<'_>) -> Self
[src]
Constructor, take the command tree as input
pub fn complete_cmd(
&self,
line: &str,
pos: usize
) -> Result<(usize, Vec<String>)>
[src]
&self,
line: &str,
pos: usize
) -> Result<(usize, Vec<String>)>
Takes the currently edited line
with the cursor pos
ition and
returns the start position and the completion candidates for the
partial path to be completed.
pub fn _complete_cmd(node: &PrefixNode, line: &str, pos: usize) -> Vec<String>
[src]
Get all commands that match the line and pos
Trait Implementations
impl Completer for PrefixCompleter
[src]
type Candidate = String
Specific completion candidate.
fn complete(
&self,
line: &str,
pos: usize,
_ctx: &Context<'_>
) -> Result<(usize, Vec<String>)>
[src]
&self,
line: &str,
pos: usize,
_ctx: &Context<'_>
) -> Result<(usize, Vec<String>)>
Complete command
pub fn update(&self, line: &mut LineBuffer, start: usize, elected: &str)
[src]
impl Helper for PrefixCompleter
[src]
impl Highlighter for PrefixCompleter
[src]
pub fn highlight(&self, line: &'l str, pos: usize) -> Cow<'l, str>
[src]
pub fn highlight_prompt<'b, 's, 'p>(
&'s self,
prompt: &'p str,
default: bool
) -> Cow<'b, str> where
's: 'b,
'p: 'b,
[src]
&'s self,
prompt: &'p str,
default: bool
) -> Cow<'b, str> where
's: 'b,
'p: 'b,
pub fn highlight_hint(&self, hint: &'h str) -> Cow<'h, str>
[src]
pub fn highlight_candidate(
&self,
candidate: &'c str,
completion: CompletionType
) -> Cow<'c, str>
[src]
&self,
candidate: &'c str,
completion: CompletionType
) -> Cow<'c, str>
pub fn highlight_char(&self, line: &str, pos: usize) -> bool
[src]
impl Hinter for PrefixCompleter
[src]
impl Validator for PrefixCompleter
[src]
pub fn validate(
&self,
ctx: &mut ValidationContext<'_>
) -> Result<ValidationResult, ReadlineError>
[src]
&self,
ctx: &mut ValidationContext<'_>
) -> Result<ValidationResult, ReadlineError>
pub fn validate_while_typing(&self) -> bool
[src]
Auto Trait Implementations
impl RefUnwindSafe for PrefixCompleter
[src]
impl Send for PrefixCompleter
[src]
impl Sync for PrefixCompleter
[src]
impl Unpin for PrefixCompleter
[src]
impl UnwindSafe for PrefixCompleter
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,