35 lines
1.1 KiB
Rust
35 lines
1.1 KiB
Rust
|
use serde::{Serialize, Deserialize, Deserializer};
|
||
|
use std::collections::HashMap;
|
||
|
|
||
|
fn default_config_resource() -> String {
|
||
|
String::from("")
|
||
|
}
|
||
|
fn default_sitewith() -> Vec<String> {
|
||
|
Vec::new()
|
||
|
}
|
||
|
fn default_config_tpls() -> HashMap<String,String> {
|
||
|
HashMap::new()
|
||
|
}
|
||
|
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||
|
pub struct ReqSettings {
|
||
|
pub name: String,
|
||
|
pub author: String,
|
||
|
pub fullname: String,
|
||
|
pub desc: String,
|
||
|
#[serde(default = "default_config_resource")]
|
||
|
pub url: String,
|
||
|
#[serde(default = "default_config_resource")]
|
||
|
pub trace_url: String,
|
||
|
#[serde(default = "default_config_resource")]
|
||
|
pub title: String,
|
||
|
#[serde(default = "default_config_resource")]
|
||
|
pub subtitle: String,
|
||
|
#[serde(default = "default_config_resource")]
|
||
|
pub pagetitle: String,
|
||
|
#[serde(default = "default_config_tpls")]
|
||
|
pub tpls: HashMap<String,String>,
|
||
|
#[serde(default = "default_config_resource")]
|
||
|
pub sid: String,
|
||
|
#[serde(default = "default_sitewith")]
|
||
|
pub sitewith: Vec<String>,
|
||
|
}
|