pub struct Module {
pub magic: [u8; 4],
pub shebang: Option<String>,
pub path: String,
pub meta: Vec<Meta>,
pub imports: Vec<Import>,
pub globals: Vec<Variable>,
pub externs: Vec<Extern>,
pub structs: Vec<Struct>,
pub functions: Vec<Function>,
}
Fields§
§magic: [u8; 4]
§shebang: Option<String>
§path: String
§meta: Vec<Meta>
§imports: Vec<Import>
§globals: Vec<Variable>
§externs: Vec<Extern>
§structs: Vec<Struct>
§functions: Vec<Function>
Implementations§
Source§impl Module
impl Module
pub fn from_ast(ast: &AstModule) -> CompilationResult<Self>
pub fn from_json(source: &str) -> Result<Self>
pub fn to_json(&self, pretty: bool) -> Result<String>
pub fn globals_map(&self) -> Vec<(usize, String)>
pub fn externs_map(&self) -> Vec<(usize, String)>
pub fn structs_map(&self) -> Vec<(usize, String)>
pub fn functions_map(&self) -> Vec<(usize, String)>
pub fn find_struct(&self, id: &str) -> Option<&Struct>
pub fn find_function(&self, id: &str) -> Option<&Function>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Module
impl<'de> Deserialize<'de> for Module
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more