#[non_exhaustive]pub struct InteractiveButton {
pub id: Option<i32>,
pub style: ButtonStyle,
pub custom_id: CompactString,
pub label: Option<CompactString>,
pub emoji: Option<PartialEmoji>,
pub disabled: bool,
}Expand description
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).
style: ButtonStyleThe style: one of Primary, Secondary, Success, Danger.
custom_id: CompactStringThe developer-defined identifier (1-100 characters).
label: Option<CompactString>The text on the button (max 80 characters).
emoji: Option<PartialEmoji>The emoji on the button.
disabled: boolWhether the button is disabled.
Implementations§
Source§impl InteractiveButton
impl InteractiveButton
Sourcepub fn new(style: ButtonStyle, custom_id: impl Into<CompactString>) -> Self
pub fn new(style: ButtonStyle, custom_id: impl Into<CompactString>) -> Self
Creates an enabled button without label or emoji (set at least one before sending).
discord.js counterpart: ButtonBuilder (@discordjs/builders).
Trait Implementations§
Source§impl Clone for InteractiveButton
impl Clone for InteractiveButton
Source§impl Debug for InteractiveButton
impl Debug for InteractiveButton
impl Eq for InteractiveButton
Source§impl From<InteractiveButton> for Button
impl From<InteractiveButton> for Button
Source§fn from(button: InteractiveButton) -> Self
fn from(button: InteractiveButton) -> Self
Converts to this type from the input type.
Source§impl From<InteractiveButton> for Component
impl From<InteractiveButton> for Component
Source§fn from(button: InteractiveButton) -> Self
fn from(button: InteractiveButton) -> Self
Converts to this type from the input type.
Source§impl PartialEq for InteractiveButton
impl PartialEq for InteractiveButton
Source§impl Serialize for InteractiveButton
impl Serialize for InteractiveButton
impl StructuralPartialEq for InteractiveButton
Auto Trait Implementations§
impl Freeze for InteractiveButton
impl RefUnwindSafe for InteractiveButton
impl Send for InteractiveButton
impl Sync for InteractiveButton
impl Unpin for InteractiveButton
impl UnsafeUnpin for InteractiveButton
impl UnwindSafe for InteractiveButton
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