#[non_exhaustive]pub struct CheckboxGroup {
pub id: Option<i32>,
pub custom_id: CompactString,
pub options: Vec<GroupOption>,
pub min_values: Option<u8>,
pub max_values: Option<u8>,
pub required: bool,
}Expand description
A checkbox group in a modal: any number of 1-10 options.
discord.js counterpart: CheckboxGroupComponent.
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 (1-10).
min_values: Option<u8>The minimum number of options to check (Discord’s default: 1; 0-10).
max_values: Option<u8>The maximum number of options to check (Discord’s default: the number of options).
required: boolWhether checking is required to submit the modal (default true).
Implementations§
Source§impl CheckboxGroup
impl CheckboxGroup
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 checkbox group.
discord.js counterpart: APICheckboxGroupComponent (discord-api-types).
Trait Implementations§
Source§impl Clone for CheckboxGroup
impl Clone for CheckboxGroup
Source§impl Debug for CheckboxGroup
impl Debug for CheckboxGroup
impl Eq for CheckboxGroup
Source§impl From<CheckboxGroup> for Component
impl From<CheckboxGroup> for Component
Source§fn from(component: CheckboxGroup) -> Self
fn from(component: CheckboxGroup) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CheckboxGroup
impl PartialEq for CheckboxGroup
Source§impl Serialize for CheckboxGroup
impl Serialize for CheckboxGroup
impl StructuralPartialEq for CheckboxGroup
Auto Trait Implementations§
impl Forget for CheckboxGroup
impl Freeze for CheckboxGroup
impl Move for CheckboxGroup
impl RefUnwindSafe for CheckboxGroup
impl Send for CheckboxGroup
impl Sync for CheckboxGroup
impl Unpin for CheckboxGroup
impl UnsafeUnpin for CheckboxGroup
impl UnwindSafe for CheckboxGroup
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