pub enum Component<'a> {
ActionRow(ActionRow<'a>),
Button(Button<'a>),
SelectMenu(SelectMenu<'a>),
TextInput(TextInput<'a>),
}Expand description
Top-level component type.
In messages, this is usually an ActionRow.
Variants§
ActionRow(ActionRow<'a>)
An action row containing other components.
Button(Button<'a>)
A button component (only valid inside ActionRow).
SelectMenu(SelectMenu<'a>)
A select menu (only valid inside ActionRow).
TextInput(TextInput<'a>)
A text input (only valid in modals).
Trait Implementations§
Source§impl<'de, 'a> Deserialize<'de> for Component<'a>
impl<'de, 'a> Deserialize<'de> for Component<'a>
Source§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
Source§impl<'a> From<ActionRowBuilder<'a>> for Component<'a>
impl<'a> From<ActionRowBuilder<'a>> for Component<'a>
Source§fn from(builder: ActionRowBuilder<'a>) -> Self
fn from(builder: ActionRowBuilder<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<ButtonBuilder<'a>> for Component<'a>
impl<'a> From<ButtonBuilder<'a>> for Component<'a>
Source§fn from(builder: ButtonBuilder<'a>) -> Self
fn from(builder: ButtonBuilder<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<SelectMenuBuilder<'a>> for Component<'a>
impl<'a> From<SelectMenuBuilder<'a>> for Component<'a>
Source§fn from(builder: SelectMenuBuilder<'a>) -> Self
fn from(builder: SelectMenuBuilder<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for Component<'a>
impl<'a> RefUnwindSafe for Component<'a>
impl<'a> Send for Component<'a>
impl<'a> Sync for Component<'a>
impl<'a> Unpin for Component<'a>
impl<'a> UnwindSafe for Component<'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