ocpi 0.3.5

Unofficial, in progress, OCPI implementation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::{command_result_type::CommandResultType, DisplayText};

#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct CommandResult {
    pub result: CommandResultType,

    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub message: Vec<DisplayText>,
}

impl CommandResult {
    pub fn with_message(mut self, message: DisplayText) -> Self {
        self.message.push(message);
        self
    }
}