pub struct SlashPicker { /* private fields */ }Implementations§
Source§impl SlashPicker
impl SlashPicker
Sourcepub fn from_prompt_line(first_line: &str) -> Option<Self>
pub fn from_prompt_line(first_line: &str) -> Option<Self>
Build a picker for a full prompt line (first row only).
Returns None when the line does not start with /.
The filter is the text after the leading slash, truncated
at the first whitespace: /pos BTC filters on pos.
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Picker is active when there is at least one match to show. An inactive picker renders nothing.
pub fn matches(&self) -> &[SlashMatch]
pub const fn selected_index(&self) -> usize
Sourcepub fn selected(&self) -> Option<&SlashMatch>
pub fn selected(&self) -> Option<&SlashMatch>
Currently highlighted entry, or None when inactive.
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Move selection down (wraps to top at the bottom).
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Move selection up (wraps to bottom at the top).
Sourcepub fn completion_text(&self) -> Option<String>
pub fn completion_text(&self) -> Option<String>
After Tab-complete, the caller replaces the prompt with
this literal. A trailing space is appended so the operator
can immediately type arguments (e.g. /regime BTC).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SlashPicker
impl RefUnwindSafe for SlashPicker
impl Send for SlashPicker
impl Sync for SlashPicker
impl Unpin for SlashPicker
impl UnsafeUnpin for SlashPicker
impl UnwindSafe for SlashPicker
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 more