twilight_model/channel/message/component/label.rs
1use serde::{Deserialize, Serialize};
2
3use super::Component;
4
5/// Top-level layout [`Component`].
6///
7/// Labels wrap modal components with text as a label and an optional description.
8#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)]
9pub struct Label {
10 /// Optional identifier for the label.
11 #[serde(skip_serializing_if = "Option::is_none")]
12 pub id: Option<i32>,
13 /// The label text; max 45 characters.
14 #[allow(clippy::struct_field_names)]
15 pub label: String,
16 /// An optional description text for the label; max 100 characters.
17 #[serde(skip_serializing_if = "Option::is_none")]
18 pub description: Option<String>,
19 /// The component within the label.
20 pub component: Box<Component>,
21}