Add EdidProduct, as user data for kms Outputs
This is the same as `libdisplay_info::edid::VendorProduct`, but with implementations for `Serialize`, `Eq`, etc.
This commit is contained in:
parent
2fe5897db0
commit
e74eafce2c
3 changed files with 39 additions and 4 deletions
|
|
@ -94,6 +94,29 @@ impl From<Output> for OutputInfo {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct EdidProduct {
|
||||
pub manufacturer: [char; 3],
|
||||
pub product: u16,
|
||||
pub serial: Option<u32>,
|
||||
pub manufacture_week: i32,
|
||||
pub manufacture_year: i32,
|
||||
pub model_year: Option<i32>,
|
||||
}
|
||||
|
||||
impl From<libdisplay_info::edid::VendorProduct> for EdidProduct {
|
||||
fn from(vp: libdisplay_info::edid::VendorProduct) -> Self {
|
||||
Self {
|
||||
manufacturer: vp.manufacturer,
|
||||
product: vp.product,
|
||||
serial: vp.serial,
|
||||
manufacture_week: vp.manufacture_week,
|
||||
manufacture_year: vp.manufacture_year,
|
||||
model_year: vp.model_year,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Deserialize, Serialize)]
|
||||
pub struct NumlockStateConfig {
|
||||
pub last_state: bool,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue