pub struct ButtonBuilder<'a> { /* private fields */ }Expand description
Builder for creating a Button.
Implementations§
Source§impl<'a> ButtonBuilder<'a>
impl<'a> ButtonBuilder<'a>
Sourcepub fn primary(
label: impl Into<TitanString<'a>>,
custom_id: impl Into<TitanString<'a>>,
) -> Self
pub fn primary( label: impl Into<TitanString<'a>>, custom_id: impl Into<TitanString<'a>>, ) -> Self
Create a primary (blurple) button.
Sourcepub fn secondary(
label: impl Into<TitanString<'a>>,
custom_id: impl Into<TitanString<'a>>,
) -> Self
pub fn secondary( label: impl Into<TitanString<'a>>, custom_id: impl Into<TitanString<'a>>, ) -> Self
Create a secondary (grey) button.
Sourcepub fn success(
label: impl Into<TitanString<'a>>,
custom_id: impl Into<TitanString<'a>>,
) -> Self
pub fn success( label: impl Into<TitanString<'a>>, custom_id: impl Into<TitanString<'a>>, ) -> Self
Create a success (green) button.
Sourcepub fn danger(
label: impl Into<TitanString<'a>>,
custom_id: impl Into<TitanString<'a>>,
) -> Self
pub fn danger( label: impl Into<TitanString<'a>>, custom_id: impl Into<TitanString<'a>>, ) -> Self
Create a danger (red) button.
Sourcepub fn link(
label: impl Into<TitanString<'a>>,
url: impl Into<TitanString<'a>>,
) -> Self
pub fn link( label: impl Into<TitanString<'a>>, url: impl Into<TitanString<'a>>, ) -> Self
Create a link button (opens URL).
Sourcepub fn style(self, style: ButtonStyle) -> Self
pub fn style(self, style: ButtonStyle) -> Self
Set style.
Sourcepub fn label(self, label: impl Into<TitanString<'a>>) -> Self
pub fn label(self, label: impl Into<TitanString<'a>>) -> Self
Set label.
Sourcepub fn emoji(self, emoji: impl Into<ReactionEmoji<'a>>) -> Self
pub fn emoji(self, emoji: impl Into<ReactionEmoji<'a>>) -> Self
Set emoji.
Sourcepub fn custom_id(self, id: impl Into<TitanString<'a>>) -> Self
pub fn custom_id(self, id: impl Into<TitanString<'a>>) -> Self
Set custom ID.
Sourcepub fn url(self, url: impl Into<TitanString<'a>>) -> Self
pub fn url(self, url: impl Into<TitanString<'a>>) -> Self
Set URL.
Trait Implementations§
Source§impl<'a> Clone for ButtonBuilder<'a>
impl<'a> Clone for ButtonBuilder<'a>
Source§fn clone(&self) -> ButtonBuilder<'a>
fn clone(&self) -> ButtonBuilder<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ButtonBuilder<'a>
impl<'a> Debug for ButtonBuilder<'a>
Source§impl Default for ButtonBuilder<'_>
impl Default for ButtonBuilder<'_>
Source§impl<'a> From<ButtonBuilder<'a>> for Component<'a>
ButtonBuilder automatically converts to Component
impl<'a> From<ButtonBuilder<'a>> for Component<'a>
ButtonBuilder automatically converts to Component
Source§fn from(builder: ButtonBuilder<'a>) -> Self
fn from(builder: ButtonBuilder<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for ButtonBuilder<'a>
impl<'a> RefUnwindSafe for ButtonBuilder<'a>
impl<'a> Send for ButtonBuilder<'a>
impl<'a> Sync for ButtonBuilder<'a>
impl<'a> Unpin for ButtonBuilder<'a>
impl<'a> UnwindSafe for ButtonBuilder<'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