pub struct Button<'a> {
pub component_type: ComponentType,
pub style: ButtonStyle,
pub label: Option<TitanString<'a>>,
pub emoji: Option<ReactionEmoji<'a>>,
pub custom_id: Option<TitanString<'a>>,
pub url: Option<TitanString<'a>>,
pub disabled: bool,
}Expand description
A clickable button.
Fields§
§component_type: ComponentTypeType 2 (Button).
style: ButtonStyleStyle of the button.
label: Option<TitanString<'a>>Text label (max 80 characters).
emoji: Option<ReactionEmoji<'a>>Emoji to display.
custom_id: Option<TitanString<'a>>Custom ID (max 100 chars). Required for non-link buttons.
url: Option<TitanString<'a>>URL for link buttons.
disabled: boolWhether the button is disabled.
Implementations§
Source§impl<'a> Button<'a>
impl<'a> Button<'a>
Sourcepub fn builder(
custom_id: impl Into<TitanString<'a>>,
style: ButtonStyle,
) -> ButtonBuilder<'a>
pub fn builder( custom_id: impl Into<TitanString<'a>>, style: ButtonStyle, ) -> ButtonBuilder<'a>
Create a builder for a Button.
Sourcepub fn builder_link(url: impl Into<TitanString<'a>>) -> ButtonBuilder<'a>
pub fn builder_link(url: impl Into<TitanString<'a>>) -> ButtonBuilder<'a>
Create a builder for a Link Button.
Trait Implementations§
Source§impl<'de, 'a> Deserialize<'de> for Button<'a>
impl<'de, 'a> Deserialize<'de> for Button<'a>
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Button<'a>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Button<'a>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> Serialize for Button<'a>
impl<'a> Serialize for Button<'a>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<'a> Freeze for Button<'a>
impl<'a> RefUnwindSafe for Button<'a>
impl<'a> Send for Button<'a>
impl<'a> Sync for Button<'a>
impl<'a> Unpin for Button<'a>
impl<'a> UnwindSafe for Button<'a>
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