mirror of
https://github.com/mbilker/vgpu_unlock-rs.git
synced 2026-01-17 11:57:00 +01:00
41 lines
768 B
Rust
41 lines
768 B
Rust
// SPDX-License-Identifier: MIT
|
|
|
|
use std::collections::HashMap;
|
|
|
|
use serde::Deserialize;
|
|
|
|
struct Defaults;
|
|
|
|
impl Defaults {
|
|
#[inline]
|
|
const fn unlock() -> bool {
|
|
true
|
|
}
|
|
|
|
#[inline]
|
|
const fn unlock_migration() -> bool {
|
|
false
|
|
}
|
|
}
|
|
|
|
#[derive(Deserialize)]
|
|
pub struct Config {
|
|
#[serde(default = "Defaults::unlock")]
|
|
pub unlock: bool,
|
|
#[serde(default = "Defaults::unlock_migration")]
|
|
pub unlock_migration: bool,
|
|
#[serde(default)]
|
|
pub pci_info_map: Option<HashMap<u32, u32>>,
|
|
}
|
|
|
|
impl Default for Config {
|
|
#[inline]
|
|
fn default() -> Self {
|
|
Self {
|
|
unlock: Defaults::unlock(),
|
|
unlock_migration: Defaults::unlock_migration(),
|
|
pci_info_map: None,
|
|
}
|
|
}
|
|
}
|