//! **note** the order of fields is the order of parsing. /// An IDL module. /// /// Parsing order: /// - use declarations, /// - items #[derive(Debug)] pub struct IDLModule { // why: only allow use before other items // parser will error if use is present in any other place pub uses: Vec, pub items: Vec } #[derive(Debug)] pub enum Item { Interface(ItemInterface), Type(ItemType) } #[derive(Debug)] pub struct Function { pub name: String, } #[derive(Debug)] pub struct ItemInterface { pub name: String, pub functions: Vec } #[derive(Debug)] pub struct ItemType { pub name: String, pub referree: String } #[derive(Debug)] pub struct UseDecl { pub module: String }