pub struct IRModule {Show 14 fields
pub name: String,
pub metadata: HashMap<String, NargoValue>,
pub script: Option<JsProgram>,
pub script_server: Option<JsProgram>,
pub script_client: Option<JsProgram>,
pub script_meta: Option<NargoValue>,
pub template: Option<TemplateIR>,
pub hoisted_nodes: HashMap<String, TemplateNodeIR>,
pub styles: Vec<StyleIR>,
pub i18n: Option<HashMap<String, HashMap<String, String>>>,
pub wasm: Vec<Vec<u8>>,
pub custom_blocks: Vec<CustomBlockIR>,
pub tests: Vec<TestIR>,
pub span: Span,
}Expand description
IR 模块
表示一个完整的 HXO IR 模块,包含脚本、模板、样式等信息
Fields§
§name: String模块名称
模块的唯一标识符
metadata: HashMap<String, NargoValue>元数据
模块的附加信息
script: Option<JsProgram>脚本
通用脚本代码
script_server: Option<JsProgram>服务端脚本
仅在服务端执行的脚本代码
script_client: Option<JsProgram>客户端脚本
仅在客户端执行的脚本代码
script_meta: Option<NargoValue>脚本元数据
用于脚本分析结果的元数据
template: Option<TemplateIR>模板
模块的模板结构
hoisted_nodes: HashMap<String, TemplateNodeIR>提升节点
被提升的模板节点
styles: Vec<StyleIR>样式
模块的样式定义
i18n: Option<HashMap<String, HashMap<String, String>>>国际化
模块的国际化文本
wasm: Vec<Vec<u8>>WASM
WebAssembly 模块
custom_blocks: Vec<CustomBlockIR>自定义块
模块的自定义块
tests: Vec<TestIR>测试
模块的测试用例
span: Span位置信息
模块在源文件中的位置
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IRModule
impl<'de> Deserialize<'de> for IRModule
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
impl StructuralPartialEq for IRModule
Auto Trait Implementations§
impl Freeze for IRModule
impl RefUnwindSafe for IRModule
impl Send for IRModule
impl Sync for IRModule
impl Unpin for IRModule
impl UnsafeUnpin for IRModule
impl UnwindSafe for IRModule
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