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 /// Optional identifier for the section.
8 #[serde(skip_serializing_if = "Option::is_none")]
9 pub id: Option<i32>,
10 /// One to three [text components].
11 ///
12 /// [text components]: super::TextDisplay
13 pub components: Vec<Component>,
14 /// An accessory component for this section.
15 ///
16 /// Currently, only [`Thumbnail`] and [`Button`] components are supported here.
17 ///
18 /// [`Thumbnail`]: super::Thumbnail
19 /// [`Button`]: super::Button
20 pub accessory: Box<Component>,
21}