pub struct SchemaAwareCompleter { /* private fields */ }Expand description
Schema-aware completer for Poka-Yoke input validation
Implementations§
Source§impl SchemaAwareCompleter
impl SchemaAwareCompleter
Sourcepub fn new(session: &ReplSession) -> Self
pub fn new(session: &ReplSession) -> Self
Create a new completer from session state
Sourcepub fn complete(&self, input: &str) -> Vec<String>
pub fn complete(&self, input: &str) -> Vec<String>
Get completions for the given input
Returns a list of possible completions.
Sourcepub fn update_columns(&mut self, session: &ReplSession)
pub fn update_columns(&mut self, session: &ReplSession)
Update column names from session
Sourcepub fn update_datasets(&mut self, session: &ReplSession)
pub fn update_datasets(&mut self, session: &ReplSession)
Update dataset names from session
Trait Implementations§
Source§impl Completer for SchemaAwareCompleter
Available on crate feature repl only.
impl Completer for SchemaAwareCompleter
Available on crate feature
repl only.Source§fn complete(&mut self, line: &str, pos: usize) -> Vec<Suggestion>
fn complete(&mut self, line: &str, pos: usize) -> Vec<Suggestion>
the action that will take the line and position and convert it to a vector of completions, which include the
span to replace and the contents of that replacement
Source§fn complete_with_base_ranges(
&mut self,
line: &str,
pos: usize,
) -> (Vec<Suggestion>, Vec<Range<usize>>)
fn complete_with_base_ranges( &mut self, line: &str, pos: usize, ) -> (Vec<Suggestion>, Vec<Range<usize>>)
same as
Completer::complete but it will return a vector of ranges of the strings
the suggestions are based onSource§fn partial_complete(
&mut self,
line: &str,
pos: usize,
start: usize,
offset: usize,
) -> Vec<Suggestion>
fn partial_complete( &mut self, line: &str, pos: usize, start: usize, offset: usize, ) -> Vec<Suggestion>
action that will return a partial section of available completions
this command comes handy when trying to avoid to pull all the data at once
from the completer
Auto Trait Implementations§
impl Freeze for SchemaAwareCompleter
impl RefUnwindSafe for SchemaAwareCompleter
impl Send for SchemaAwareCompleter
impl Sync for SchemaAwareCompleter
impl Unpin for SchemaAwareCompleter
impl UnsafeUnpin for SchemaAwareCompleter
impl UnwindSafe for SchemaAwareCompleter
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
Mutably borrows from an owned value. Read more
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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.