#[non_exhaustive]pub struct Choice<T> {
pub name: CompactString,
pub name_localizations: BTreeMap<Locale, CompactString>,
pub value: T,
}Expand description
A choice of an option
(also used for autocomplete suggestions). T is the option’s value type.
discord.js counterpart: APIApplicationCommandOptionChoice.
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.name: CompactStringThe name shown to the user (1-100 characters).
name_localizations: BTreeMap<Locale, CompactString>Translations of the name, keyed by locale (D-058).
value: TThe value sent to the app.
Implementations§
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Choice<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Choice<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq> Eq for Choice<T>
impl<T: PartialEq> StructuralPartialEq for Choice<T>
Auto Trait Implementations§
impl<T> Freeze for Choice<T>where
T: Freeze,
impl<T> RefUnwindSafe for Choice<T>where
T: RefUnwindSafe,
impl<T> Send for Choice<T>where
T: Send,
impl<T> Sync for Choice<T>where
T: Sync,
impl<T> Unpin for Choice<T>where
T: Unpin,
impl<T> UnsafeUnpin for Choice<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Choice<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