twilight_model/channel/message/component/
action_row.rs

1use serde::{Deserialize, Serialize};
2
3use super::Component;
4
5/// Non-interactive [`Component`] container of other (non action row) components.
6#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize, Serialize)]
7pub struct ActionRow {
8    /// Optional identifier for the action row.
9    #[serde(skip_serializing_if = "Option::is_none")]
10    pub id: Option<i32>,
11    /// List of components in the action row.
12    pub components: Vec<Component>,
13}
14
15#[cfg(test)]
16mod tests {
17    use super::*;
18    use static_assertions::{assert_fields, assert_impl_all};
19    use std::{fmt::Debug, hash::Hash};
20
21    assert_fields!(ActionRow: components);
22    assert_impl_all!(ActionRow: Clone, Debug, Eq, Hash, PartialEq, Send, Sync);
23}