fundamentum_sdk_mqtt/models/actions/
client_action.rs

1use fundamentum_iot_mqtt_proto::com::fundamentum::actions::v1 as cloud_proto;
2
3/// Action type representing a custom Action defined by the client.
4#[derive(Debug, Clone, PartialEq, Eq, Hash)]
5pub struct ClientAction {
6    /// Version of the protocol used to encode the data in the payload.
7    pub version: u32,
8    /// Type of the action.
9    pub r#type: u32,
10    /// Payload of the action.
11    /// The actual structure and content of this payload are opaque within this context,
12    /// as it is entirely managed and interpreted by the client's specific encoders/decoders.
13    pub payload: Vec<u8>,
14}
15
16impl From<cloud_proto::ClientAction> for ClientAction {
17    fn from(client_action: cloud_proto::ClientAction) -> Self {
18        Self {
19            version: client_action.version,
20            r#type: client_action.r#type,
21            payload: client_action.payload,
22        }
23    }
24}