1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use super::{Deserialize, Serialize};
use std::borrow::Cow;

/// Describes the `Family`, `Brand` and `Model` of a `Device`
#[derive(Clone, Debug, Serialize, Deserialize, Eq, Hash, PartialEq)]
pub struct Device<'a> {
    pub family: Cow<'a, str>,
    pub brand: Option<Cow<'a, str>>,
    pub model: Option<Cow<'a, str>>,
}

impl<'a> Default for Device<'a> {
    fn default() -> Self {
        Self {
            family: Cow::Borrowed("Other"),
            brand: None,
            model: None,
        }
    }
}