pub struct CompletionItem {
pub value: Cow<'static, str>,
pub description: Option<Cow<'static, str>>,
}Expand description
A single completion item with optional description
Fields§
§value: Cow<'static, str>The completion value
description: Option<Cow<'static, str>>Optional description for the completion
Implementations§
Source§impl CompletionItem
impl CompletionItem
Sourcepub fn new(value: impl Into<Cow<'static, str>>) -> Self
pub fn new(value: impl Into<Cow<'static, str>>) -> Self
Creates a new completion item without description
Sourcepub fn with_description(
value: impl Into<Cow<'static, str>>,
desc: impl Into<Cow<'static, str>>,
) -> Self
pub fn with_description( value: impl Into<Cow<'static, str>>, desc: impl Into<Cow<'static, str>>, ) -> Self
Creates a new completion item with description
Sourcepub fn description_or_empty(&self) -> &str
pub fn description_or_empty(&self) -> &str
Returns the description or an empty string
Trait Implementations§
Source§impl Clone for CompletionItem
impl Clone for CompletionItem
Source§fn clone(&self) -> CompletionItem
fn clone(&self) -> CompletionItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CompletionItem
impl Debug for CompletionItem
Source§impl From<&'static str> for CompletionItem
impl From<&'static str> for CompletionItem
Auto Trait Implementations§
impl Freeze for CompletionItem
impl RefUnwindSafe for CompletionItem
impl Send for CompletionItem
impl Sync for CompletionItem
impl Unpin for CompletionItem
impl UnsafeUnpin for CompletionItem
impl UnwindSafe for CompletionItem
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