pub trait CompletionInput: Sized {
// Required methods
fn args(&self) -> Vec<&str>;
fn arg_index(&self) -> usize;
fn char_index(&self) -> usize;
// Provided methods
fn current_word(&self) -> &str { ... }
fn previous_word(&self) -> &str { ... }
fn complete_subcommand<'a, T>(&self, subcommands: T) -> Vec<String>
where T: IntoIterator<Item = &'a str> { ... }
fn complete_directory(&self) -> Vec<String> { ... }
fn complete_file(&self) -> Vec<String> { ... }
}
Required Methods§
fn args(&self) -> Vec<&str>
fn arg_index(&self) -> usize
fn char_index(&self) -> usize
Provided Methods§
fn current_word(&self) -> &str
fn previous_word(&self) -> &str
Sourcefn complete_subcommand<'a, T>(&self, subcommands: T) -> Vec<String>where
T: IntoIterator<Item = &'a str>,
fn complete_subcommand<'a, T>(&self, subcommands: T) -> Vec<String>where
T: IntoIterator<Item = &'a str>,
Given a list of subcommands, print any that match the current word
Sourcefn complete_directory(&self) -> Vec<String>
fn complete_directory(&self) -> Vec<String>
Print directory completions based on the current word
Sourcefn complete_file(&self) -> Vec<String>
fn complete_file(&self) -> Vec<String>
Print file completions based on the current word Also returns directories because the user may be entering a file within that directory
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.