JaneDoe-ZS/nap_data/src/tables/unlock_config_template.rs
xeon 99123a15ef newtype fun
use newtypes for template ids, pros:
1) enforces id validation
2) ease of use (helper method for getting template struct right away)
2024-07-25 01:24:48 +03:00

11 lines
241 B
Rust

use serde::Deserialize;
template_id!(UnlockConfig i32 id);
#[derive(Deserialize, Debug)]
#[serde(rename_all = "PascalCase")]
pub struct UnlockConfigTemplate {
#[serde(rename = "ID")]
pub id: UnlockConfigID,
pub name: String,
}