pub struct Metadata {
pub language_version: String,
pub compiler_version: String,
pub source_name: Option<String>,
pub compiled_at: Option<u64>,
pub required_capabilities: Vec<String>,
pub exports: Vec<ExportInfo>,
pub imports: Vec<ImportInfo>,
pub custom: HashMap<String, String>,
}Expand description
Metadata extracted from compiled bytecode.
Fields§
§language_version: StringFusabi language version used.
compiler_version: StringCompiler version.
source_name: Option<String>Original source name.
compiled_at: Option<u64>Compilation timestamp.
required_capabilities: Vec<String>Required capabilities declared in the script.
exports: Vec<ExportInfo>Exported functions.
imports: Vec<ImportInfo>Imported modules.
custom: HashMap<String, String>Custom metadata entries.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn requires_capability(&self, cap: &str) -> bool
pub fn requires_capability(&self, cap: &str) -> bool
Check if a capability is required.
Sourcepub fn get_export(&self, name: &str) -> Option<&ExportInfo>
pub fn get_export(&self, name: &str) -> Option<&ExportInfo>
Get an export by name.
Sourcepub fn imports_module(&self, module: &str) -> bool
pub fn imports_module(&self, module: &str) -> bool
Check if a module is imported.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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