pub struct Suggestion {
pub range: StringRange,
pub tooltip: Option<String>,
/* private fields */
}
Expand description
A suggestion given to the user for what they might want to type next.
The M
generic is the type of the tooltip, so for example a String
or
just ()
if you don’t care about it.
Fields§
§range: StringRange
§tooltip: Option<String>
Implementations§
Source§impl Suggestion
impl Suggestion
pub fn new(range: StringRange, text: &str) -> Suggestion
pub fn new_with_tooltip(range: StringRange, text: &str, tooltip: String) -> Self
pub fn apply(&self, input: &str) -> String
pub fn expand(&self, command: &str, range: StringRange) -> Suggestion
pub fn text(&self) -> String
Trait Implementations§
Source§impl Clone for Suggestion
impl Clone for Suggestion
Source§fn clone(&self) -> Suggestion
fn clone(&self) -> Suggestion
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Suggestion
impl Debug for Suggestion
Source§impl Hash for Suggestion
impl Hash for Suggestion
Source§impl McBufWritable for Suggestion
impl McBufWritable for Suggestion
Source§impl PartialEq for Suggestion
impl PartialEq for Suggestion
impl Eq for Suggestion
impl StructuralPartialEq for Suggestion
Auto Trait Implementations§
impl Freeze for Suggestion
impl RefUnwindSafe for Suggestion
impl Send for Suggestion
impl Sync for Suggestion
impl Unpin for Suggestion
impl UnwindSafe for Suggestion
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.