Struct reedline::DefaultCompletionActionHandler[][src]

pub struct DefaultCompletionActionHandler { /* fields omitted */ }
Expand description

A simple handler that will do a cycle-based rotation through the options given by the Completer

Implementations

Build a DefaultCompletionActionHander configured to use a specific completer

Arguments

  • completer The completion logic to use

Example

use reedline::{DefaultCompletionActionHandler, DefaultCompleter, Completer, Span};

let mut completer = DefaultCompleter::default();
completer.insert(vec!["test-hyphen","test_underscore"].iter().map(|s| s.to_string()).collect());
assert_eq!(
    completer.complete("te",2),
    vec![(Span { start: 0, end: 2 }, "test".into())]);

let mut completions = DefaultCompletionActionHandler::default().with_completer(Box::new(completer));

Trait Implementations

Handle the completion action from the given line buffer

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.