twilight_model/channel/message/component/section.rs
1use super::Component;
2use serde::{Deserialize, Serialize};
3
4/// A component representing a section of a message.
5#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)]
6pub struct Section {
7 /// An accessory component for this section.
8 ///
9 /// Currently, only [`Thumbnail`] and [`Button`] components are supported here.
10 ///
11 /// [`Thumbnail`]: super::Thumbnail
12 /// [`Button`]: super::Button
13 pub accessory: Box<Component>,
14 /// One to three [text components].
15 ///
16 /// [text components]: super::TextDisplay
17 pub components: Vec<Component>,
18 /// Optional identifier for the section.
19 #[serde(skip_serializing_if = "Option::is_none")]
20 pub id: Option<i32>,
21}