Struct CommandSuggestion
#[non_exhaustive]pub struct CommandSuggestion {
pub text: String,
pub tooltip: Option<String>,
}Expand description
One completion a custom argument offers for the text being typed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: StringThe text that replaces the typed prefix.
tooltip: Option<String>An optional explanation shown beside the completion.
Implementations§
§impl CommandSuggestion
impl CommandSuggestion
pub fn new(text: impl Into<String>) -> CommandSuggestion
pub fn new(text: impl Into<String>) -> CommandSuggestion
A completion without a tooltip.
pub fn with_tooltip(
text: impl Into<String>,
tooltip: impl Into<String>,
) -> CommandSuggestion
pub fn with_tooltip( text: impl Into<String>, tooltip: impl Into<String>, ) -> CommandSuggestion
A completion with an explanation.
Trait Implementations§
§impl Clone for CommandSuggestion
impl Clone for CommandSuggestion
§fn clone(&self) -> CommandSuggestion
fn clone(&self) -> CommandSuggestion
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 more§impl Debug for CommandSuggestion
impl Debug for CommandSuggestion
impl Eq for CommandSuggestion
§impl PartialEq for CommandSuggestion
impl PartialEq for CommandSuggestion
impl StructuralPartialEq for CommandSuggestion
Auto Trait Implementations§
impl Freeze for CommandSuggestion
impl RefUnwindSafe for CommandSuggestion
impl Send for CommandSuggestion
impl Sync for CommandSuggestion
impl Unpin for CommandSuggestion
impl UnsafeUnpin for CommandSuggestion
impl UnwindSafe for CommandSuggestion
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