yaml_def.rs 655 B

12345678910111213141516171819202122232425
  1. use serde::{Serialize, Deserialize};
  2. use std::collections::HashMap;
  3. pub type YamlRoot = HashMap<String, Module>;
  4. pub type Module = HashMap<String, Function>;
  5. #[derive(Serialize, Deserialize, PartialEq, Debug)]
  6. pub struct Function {
  7. pub efid: String,
  8. pub desc: Option<String>,
  9. pub params: Option<Vec<Param>>,
  10. pub results: Option<Vec<Param>>,
  11. }
  12. #[derive(Serialize, Deserialize, PartialEq, Debug)]
  13. pub struct Param {
  14. pub name: String,
  15. pub desc: Option<String>,
  16. #[serde(rename = "type")]
  17. pub rtype: String,
  18. pub xtyp: Option<String>,
  19. #[serde(rename = "enum")]
  20. pub enumeration: Option<HashMap<String, String>>,
  21. }