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<IRModule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IRModule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for IRModule
impl Serialize for IRModule
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more