Struct fm::completion::Completion
source · pub struct Completion {
pub kind: InputCompleted,
pub proposals: Vec<String>,
pub index: usize,
}Expand description
Holds a Vec<String> of possible completions and an usize index
showing where the user is in the vec.
Fields§
§kind: InputCompleted§proposals: Vec<String>Possible completions
index: usizeWhich completion is selected by the user
Implementations§
source§impl Completion
impl Completion
pub fn set_kind(&mut self, mode: &Mode)
sourcepub fn next(&mut self)
pub fn next(&mut self)
Move the index to next element, cycling to 0. Does nothing if the list is empty.
sourcepub fn prev(&mut self)
pub fn prev(&mut self)
Move the index to previous element, cycling to the last one. Does nothing if the list is empty.
sourcepub fn current_proposition(&self) -> &str
pub fn current_proposition(&self) -> &str
Returns the currently selected proposition.
Returns an empty string if proposals is empty.
sourcepub fn complete(
&mut self,
input_string: &str,
path_content: &PathContent,
current_path: &str
) -> FmResult<()>
pub fn complete(
&mut self,
input_string: &str,
path_content: &PathContent,
current_path: &str
) -> FmResult<()>
Fill the completions items from some parameters, depending on the mode. In Exec mode, we search for executable in $PATH starting with what the user typed. In Goto mode, we search for valid absolute & relative paths starting with what the user typed. In Search mode, we search for filenames in current directory starting with what the user typed.
Trait Implementations§
source§impl Clone for Completion
impl Clone for Completion
source§fn clone(&self) -> Completion
fn clone(&self) -> Completion
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Default for Completion
impl Default for Completion
source§fn default() -> Completion
fn default() -> Completion
Auto Trait Implementations§
impl RefUnwindSafe for Completion
impl Send for Completion
impl Sync for Completion
impl Unpin for Completion
impl UnwindSafe for Completion
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().