pub enum AutocompleteValue<T> {
None,
Focused(String),
Completed(T),
}Expand description
An autocomplete command field.
This type represent a value parsed from an autocomplete field. See “Autocomplete interactions”
in CommandModel documentation for more information.
Variants§
None
The field has not been completed yet.
Focused(String)
The field is focused by the user and being completed.
Completed(T)
The field has been completed by the user.
Trait Implementations§
source§impl<T: Clone> Clone for AutocompleteValue<T>
impl<T: Clone> Clone for AutocompleteValue<T>
source§fn clone(&self) -> AutocompleteValue<T>
fn clone(&self) -> AutocompleteValue<T>
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<T> CommandOption for AutocompleteValue<T>where
T: CommandOption,
impl<T> CommandOption for AutocompleteValue<T>where T: CommandOption,
source§fn from_option(
value: CommandOptionValue,
data: CommandOptionData,
resolved: Option<&CommandInteractionDataResolved>
) -> Result<Self, ParseOptionErrorType>
fn from_option( value: CommandOptionValue, data: CommandOptionData, resolved: Option<&CommandInteractionDataResolved> ) -> Result<Self, ParseOptionErrorType>
Convert a
CommandOptionValue into this value.source§impl<T: Debug> Debug for AutocompleteValue<T>
impl<T: Debug> Debug for AutocompleteValue<T>
source§impl<T: PartialEq> PartialEq<AutocompleteValue<T>> for AutocompleteValue<T>
impl<T: PartialEq> PartialEq<AutocompleteValue<T>> for AutocompleteValue<T>
source§fn eq(&self, other: &AutocompleteValue<T>) -> bool
fn eq(&self, other: &AutocompleteValue<T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl<T: Eq> Eq for AutocompleteValue<T>
impl<T> StructuralEq for AutocompleteValue<T>
impl<T> StructuralPartialEq for AutocompleteValue<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for AutocompleteValue<T>where T: RefUnwindSafe,
impl<T> Send for AutocompleteValue<T>where T: Send,
impl<T> Sync for AutocompleteValue<T>where T: Sync,
impl<T> Unpin for AutocompleteValue<T>where T: Unpin,
impl<T> UnwindSafe for AutocompleteValue<T>where T: UnwindSafe,
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