Enum twilight_model::application::component::Component
source · [−]pub enum Component {
ActionRow(ActionRow),
Button(Button),
SelectMenu(SelectMenu),
}Expand description
Interactive element of a message that an application uses.
Refer to Discord Docs/Message Components for additional information.
Variants
ActionRow(ActionRow)
Button(Button)
SelectMenu(SelectMenu)
Implementations
Type of component that this is.
use twilight_model::application::component::{
button::{ButtonStyle, Button},
ComponentType,
Component,
};
let component = Component::Button(Button {
custom_id: None,
disabled: false,
emoji: None,
label: Some("ping".to_owned()),
style: ButtonStyle::Primary,
url: None,
});
assert_eq!(ComponentType::Button, component.kind());Trait Implementations
fn 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
Auto Trait Implementations
impl RefUnwindSafe for Component
impl UnwindSafe for Component
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more