You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
557 B
Rust
22 lines
557 B
Rust
use anyhow::Context;
|
|
use serde::{Deserialize, Serialize};
|
|
use std::collections::HashMap;
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct GlobalConfig {
|
|
pub qemu: GlobalQemuConfig,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct GlobalQemuConfig {
|
|
pub default: Vec<String>,
|
|
pub arch: HashMap<String, Vec<String>>,
|
|
pub uefi: Vec<String>,
|
|
}
|
|
|
|
impl GlobalConfig {
|
|
pub fn load(toml: &str) -> Result<GlobalConfig, anyhow::Error> {
|
|
toml::from_str(toml).context("Failed to parse toml for global config")
|
|
}
|
|
}
|