use crate::bfrt::BFRTFieldType;
use serde::Deserialize;
#[derive(Deserialize, Debug, Clone)]
pub struct BFRTData {
#[allow(dead_code)]
mandatory: bool,
#[allow(dead_code)]
read_only: bool,
singleton: BFRTSingleton,
}
impl BFRTData {
pub fn singleton(&self) -> &BFRTSingleton {
&self.singleton
}
}
#[derive(Deserialize, Debug, Clone)]
pub struct BFRTSingleton {
id: u32,
name: String,
r#type: Option<BFRTFieldType>,
#[allow(dead_code)]
repeated: Option<bool>,
}
impl BFRTSingleton {
pub fn id(&self) -> u32 {
self.id
}
pub fn name(&self) -> &str {
&self.name
}
pub fn get_type(&self) -> &Option<BFRTFieldType> {
&self.r#type
}
}