Can issue certificate for devices

This commit is contained in:
2024-07-01 22:24:03 +02:00
parent 9ba4aa5194
commit e64a444bd0
6 changed files with 181 additions and 41 deletions

View File

@ -5,6 +5,20 @@ pub struct DeviceInfo {
max_relays: usize,
}
impl DeviceInfo {
pub fn error(&self) -> Option<&str> {
if self.reference.trim().is_empty() {
return Some("Given device reference is empty or blank!");
}
if self.max_relays == 0 {
return Some("Given device cannot handle any relay!");
}
None
}
}
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, Eq, PartialEq, Hash)]
pub struct DeviceId(pub String);