#[non_exhaustive]pub struct LinkButton {
pub id: Option<i32>,
pub url: 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).
url: CompactStringThe URL (max 512 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 LinkButton
impl LinkButton
Sourcepub fn new(url: impl Into<CompactString>) -> Self
pub fn new(url: impl Into<CompactString>) -> Self
Creates an enabled link button without label or emoji (set at least one before sending).
discord.js counterpart: ButtonBuilder with setURL (@discordjs/builders).
Trait Implementations§
Source§impl Clone for LinkButton
impl Clone for LinkButton
Source§impl Debug for LinkButton
impl Debug for LinkButton
impl Eq for LinkButton
Source§impl From<LinkButton> for Button
impl From<LinkButton> for Button
Source§fn from(button: LinkButton) -> Self
fn from(button: LinkButton) -> Self
Converts to this type from the input type.
Source§impl From<LinkButton> for Component
impl From<LinkButton> for Component
Source§fn from(button: LinkButton) -> Self
fn from(button: LinkButton) -> Self
Converts to this type from the input type.
Source§impl PartialEq for LinkButton
impl PartialEq for LinkButton
Source§impl Serialize for LinkButton
impl Serialize for LinkButton
impl StructuralPartialEq for LinkButton
Auto Trait Implementations§
impl Forget for LinkButton
impl Freeze for LinkButton
impl Move for LinkButton
impl RefUnwindSafe for LinkButton
impl Send for LinkButton
impl Sync for LinkButton
impl Unpin for LinkButton
impl UnsafeUnpin for LinkButton
impl UnwindSafe for LinkButton
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