Enum twilight_model::application::component::button::ButtonStyle
source · [−]#[non_exhaustive]
pub enum ButtonStyle {
Primary,
Secondary,
Success,
Danger,
Link,
Unknown(u8),
}Expand description
Style of a Button.
Refer to the Discord Docs/Button Object for additional information.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Primary
Button indicates a primary action.
Selecting this button style requires specifying the
Button::custom_id field.
Secondary
Button indicates a secondary action.
Selecting this button style requires specifying the
Button::custom_id field.
Success
Button indicates a successful action.
Selecting this button style requires specifying the
Button::custom_id field.
Danger
Button indicates a dangerous action.
Selecting this button style requires specifying the
Button::custom_id field.
Link
Button indicates an action with a link.
Selecting this button style requires specifying the Button::url
field.
Unknown(u8)
Variant value is unknown to the library.
Trait Implementations
sourceimpl Clone for ButtonStyle
impl Clone for ButtonStyle
sourcefn clone(&self) -> ButtonStyle
fn clone(&self) -> ButtonStyle
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for ButtonStyle
impl Debug for ButtonStyle
sourceimpl<'de> Deserialize<'de> for ButtonStyle
impl<'de> Deserialize<'de> for ButtonStyle
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<ButtonStyle> for u8
impl From<ButtonStyle> for u8
sourcefn from(value: ButtonStyle) -> Self
fn from(value: ButtonStyle) -> Self
Converts to this type from the input type.
sourceimpl From<u8> for ButtonStyle
impl From<u8> for ButtonStyle
sourceimpl Hash for ButtonStyle
impl Hash for ButtonStyle
sourceimpl PartialEq<ButtonStyle> for ButtonStyle
impl PartialEq<ButtonStyle> for ButtonStyle
sourcefn eq(&self, other: &ButtonStyle) -> bool
fn eq(&self, other: &ButtonStyle) -> bool
sourceimpl Serialize for ButtonStyle
impl Serialize for ButtonStyle
impl Copy for ButtonStyle
impl Eq for ButtonStyle
impl StructuralEq for ButtonStyle
impl StructuralPartialEq for ButtonStyle
Auto Trait Implementations
impl RefUnwindSafe for ButtonStyle
impl Send for ButtonStyle
impl Sync for ButtonStyle
impl Unpin for ButtonStyle
impl UnwindSafe for ButtonStyle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more