pub struct Completion {
pub completion: String,
pub display: Option<String>,
pub suffix: Suffix,
}Expand description
Represents a single possible completion
Fields§
§completion: StringWhole completion text
display: Option<String>Listing display string; None if matches completion
suffix: SuffixCompletion suffix; replaces append character
Implementations§
Source§impl Completion
impl Completion
Sourcepub fn simple(s: String) -> Completion
pub fn simple(s: String) -> Completion
Returns a simple Completion value, with display string matching
completion and using the default completion suffix.
Sourcepub fn completion(&self, def_suffix: Option<char>) -> Cow<'_, str>
pub fn completion(&self, def_suffix: Option<char>) -> Cow<'_, str>
Returns the full completion string, including suffix, using the given default suffix if one is not assigned to this completion.
Sourcepub fn display_chars(&self) -> usize
pub fn display_chars(&self) -> usize
Returns the number of characters displayed
Trait Implementations§
Source§impl Clone for Completion
impl Clone for Completion
Source§fn clone(&self) -> Completion
fn clone(&self) -> Completion
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for Completion
impl RefUnwindSafe for Completion
impl Send for Completion
impl Sync for Completion
impl Unpin for Completion
impl UnsafeUnpin for Completion
impl UnwindSafe for Completion
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