config: add global config with toggle to disable unlock for official vgpu cards

This commit is contained in:
Matt Bilker
2021-10-17 23:46:05 +00:00
parent b969aed98a
commit 9164fa73d9
3 changed files with 60 additions and 8 deletions

25
src/config.rs Normal file
View File

@@ -0,0 +1,25 @@
use serde::Deserialize;
struct Defaults;
impl Defaults {
#[inline]
const fn unlock() -> bool {
true
}
}
#[derive(Deserialize)]
pub struct Config {
#[serde(default = "Defaults::unlock")]
pub unlock: bool,
}
impl Default for Config {
#[inline]
fn default() -> Self {
Self {
unlock: Defaults::unlock(),
}
}
}