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 AzaleaWrite for Suggestion
impl AzaleaWrite for Suggestion
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 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