#[non_exhaustive]pub struct RadioGroup {
pub id: Option<i32>,
pub custom_id: CompactString,
pub options: Vec<GroupOption>,
pub required: bool,
}Expand description
A radio group in a modal: exactly one of 2-10 options.
discord.js counterpart: RadioGroupComponent.
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.id: Option<i32>The component’s numeric identifier (generated by Discord when not set).
custom_id: CompactStringThe developer-defined identifier (1-100 characters).
options: Vec<GroupOption>The options (2-10).
required: boolWhether a choice is required to submit the modal (default true).
Implementations§
Source§impl RadioGroup
impl RadioGroup
Sourcepub fn new(
custom_id: impl Into<CompactString>,
options: Vec<GroupOption>,
) -> Self
pub fn new( custom_id: impl Into<CompactString>, options: Vec<GroupOption>, ) -> Self
Creates a required radio group.
discord.js counterpart: APIRadioGroupComponent (discord-api-types).
Trait Implementations§
Source§impl Clone for RadioGroup
impl Clone for RadioGroup
Source§impl Debug for RadioGroup
impl Debug for RadioGroup
impl Eq for RadioGroup
Source§impl From<RadioGroup> for Component
impl From<RadioGroup> for Component
Source§fn from(component: RadioGroup) -> Self
fn from(component: RadioGroup) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RadioGroup
impl PartialEq for RadioGroup
Source§impl Serialize for RadioGroup
impl Serialize for RadioGroup
impl StructuralPartialEq for RadioGroup
Auto Trait Implementations§
impl Freeze for RadioGroup
impl RefUnwindSafe for RadioGroup
impl Send for RadioGroup
impl Sync for RadioGroup
impl Unpin for RadioGroup
impl UnsafeUnpin for RadioGroup
impl UnwindSafe for RadioGroup
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