pub struct CompletionCandidate { /* private fields */ }
Available on crate feature
unstable-dynamic
only.Expand description
A shell-agnostic completion candidate
Implementations§
Source§impl CompletionCandidate
impl CompletionCandidate
Sourcepub fn help(self, help: Option<StyledStr>) -> Self
pub fn help(self, help: Option<StyledStr>) -> Self
Set the help message of the completion candidate
Sourcepub fn id(self, id: Option<String>) -> Self
pub fn id(self, id: Option<String>) -> Self
Only first for a given Id is shown
To reduce the risk of conflicts, this should likely contain a namespace.
Sourcepub fn tag(self, tag: Option<StyledStr>) -> Self
pub fn tag(self, tag: Option<StyledStr>) -> Self
Group candidates by tag
Future: these may become user-visible
Sourcepub fn display_order(self, order: Option<usize>) -> Self
pub fn display_order(self, order: Option<usize>) -> Self
Sort weight within a CompletionCandidate::tag
Sourcepub fn hide(self, hidden: bool) -> Self
pub fn hide(self, hidden: bool) -> Self
Set the visibility of the completion candidate
Only shown when there is no visible candidate for completing the current argument.
Sourcepub fn add_prefix(self, prefix: impl Into<OsString>) -> Self
pub fn add_prefix(self, prefix: impl Into<OsString>) -> Self
Add a prefix to the value of completion candidate
This is generally used for post-process by complete
for
things like pre-pending flags, merging delimiter-separated values, etc.
Source§impl CompletionCandidate
impl CompletionCandidate
Reflection API
Sourcepub fn get_display_order(&self) -> Option<usize>
pub fn get_display_order(&self) -> Option<usize>
Get the grouping tag
Sourcepub fn is_hide_set(&self) -> bool
pub fn is_hide_set(&self) -> bool
Get the visibility of the completion candidate
Trait Implementations§
Source§impl Debug for CompletionCandidate
impl Debug for CompletionCandidate
Source§impl Default for CompletionCandidate
impl Default for CompletionCandidate
Source§fn default() -> CompletionCandidate
fn default() -> CompletionCandidate
Returns the “default value” for a type. Read more
Source§impl Ord for CompletionCandidate
impl Ord for CompletionCandidate
Source§fn cmp(&self, other: &CompletionCandidate) -> Ordering
fn cmp(&self, other: &CompletionCandidate) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CompletionCandidate
impl PartialEq for CompletionCandidate
Source§impl PartialOrd for CompletionCandidate
impl PartialOrd for CompletionCandidate
impl Eq for CompletionCandidate
impl StructuralPartialEq for CompletionCandidate
Auto Trait Implementations§
impl Freeze for CompletionCandidate
impl RefUnwindSafe for CompletionCandidate
impl Send for CompletionCandidate
impl Sync for CompletionCandidate
impl Unpin for CompletionCandidate
impl UnwindSafe for CompletionCandidate
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