pub struct Completion {
pub content: 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§
§content: Vec<String>Possible completions
index: usizeWhich completion is selected by the user
Implementations§
Source§impl Completion
impl Completion
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 cd(&mut self, current_path: &str, input_string: &str)
pub fn cd(&mut self, current_path: &str, input_string: &str)
Cd completion. Looks for the valid path completing what the user typed.
Sourcepub fn exec(&mut self, input_string: &str)
pub fn exec(&mut self, input_string: &str)
Looks for programs in $PATH completing the one typed by the user.
Sourcepub fn action(&mut self, input_string: &str)
pub fn action(&mut self, input_string: &str)
Looks for fm actions completing the one typed by the user.
Sourcepub fn search(&mut self, files: Vec<String>)
pub fn search(&mut self, files: Vec<String>)
Looks for file within current folder completing what the user typed.
Sourcepub fn complete_input_string(&self, input_string: &str) -> Option<&str>
pub fn complete_input_string(&self, input_string: &str) -> Option<&str>
Complete the input string with current_proposition if possible. Returns the optional last chars of the current_proposition. If the current_proposition doesn’t start with input_string, it returns None.
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 Content<String> for Completion
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: selected, content, push, style.
selected returns an optional reference to the value.
impl Content<String> for Completion
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: selected, content, push, style.
selected returns an optional reference to the value.
Source§impl Default for Completion
impl Default for Completion
Source§fn default() -> Completion
fn default() -> Completion
Source§impl DrawMenu<String> for Completion
impl DrawMenu<String> for Completion
Source§impl Selectable for Completion
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, set_index and selected_is_last.
impl Selectable for Completion
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, set_index and selected_is_last.
Auto Trait Implementations§
impl Freeze for Completion
impl RefUnwindSafe for Completion
impl Send for Completion
impl Sync for Completion
impl Unpin for Completion
impl UnsafeUnpin for Completion
impl UnwindSafe for Completion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.