Struct FilenameCompleter

pub struct FilenameCompleter { /* private fields */ }

A Completer for file and folder names.

Implementations

impl FilenameCompleter

fn new() -> Self

Constructor

fn complete_path(&self, line: &str, pos: usize) -> Result<(usize, Vec<Pair>)>

Takes the currently edited line with the cursor position and returns the start position and the completion candidates for the partial path to be completed.

Errors

Will return Err if candidates cannot be retrieved

fn complete_path_unsorted(&self, line: &str, pos: usize) -> Result<(usize, Vec<Pair>)>

Similar to Self::complete_path, but the returned paths are unsorted.

Errors

Will return Err if candidates cannot be retrieved

Trait Implementations

impl Completer for FilenameCompleter

type Candidate = Pair;
fn complete(&self, line: &str, pos: usize, _ctx: &Context<'_>) -> Result<(usize, Vec<Pair>)>

impl Default for FilenameCompleter

fn default() -> Self

Auto Trait Implementations

impl Freeze for FilenameCompleter

impl RefUnwindSafe for FilenameCompleter

impl Send for FilenameCompleter

impl Sync for FilenameCompleter

impl Unpin for FilenameCompleter

impl UnsafeUnpin for FilenameCompleter

impl UnwindSafe for FilenameCompleter

Blanket Implementations

impl<T> Any for FilenameCompleter where T: 'static + ?Sized,

impl<T> Borrow<T> for FilenameCompleter where T: ?Sized,

impl<T> BorrowMut<T> for FilenameCompleter where T: ?Sized,

impl<T> From<T> for FilenameCompleter

impl<T, U> Into<U> for FilenameCompleter where U: From<T>,

impl<T, U> TryFrom<U> for FilenameCompleter where U: Into<T>,

impl<T, U> TryInto<U> for FilenameCompleter where U: TryFrom<T>,