applin/widget/
last_error_text.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
4pub struct LastErrorText {
5 #[serde(default, skip_serializing_if = "String::is_empty")]
6 pub id: String,
7}
8impl LastErrorText {
9 #[must_use]
10 pub fn with_id(mut self, id: impl AsRef<str>) -> Self {
11 self.id = id.as_ref().to_string();
12 self
13 }
14}
15
16#[must_use]
17pub fn last_error_text() -> LastErrorText {
18 LastErrorText { id: String::new() }
19}