/// An entry in a WebAssembly component's export section. #[derive(Debug)] pubstruct ComponentExport<'a> { /// Where this export was defined. pub span: Span, /// Optional identifier bound to this export. pub id: Option<Id<'a>>, /// An optional name for this instance stored in the custom `name` section. pub debug_name: Option<NameAnnotation<'a>>, /// The name of this export from the component. pub name: ComponentExternName<'a>, /// The kind of export. pub kind: ComponentExportKind<'a>, /// The kind of export. pub ty: Option<ItemSigNoName<'a>>,
}
impl<'a> Parse<'a> for ComponentExport<'a> { fn parse(parser: Parser<'a>) -> Result<Self> { let span = parser.parse::<kw::export>()?.0; let id = parser.parse()?; let debug_name = parser.parse()?; let name = parser.parse()?; let kind = parser.parse()?; let ty = if !parser.is_empty() {
Some(parser.parens(|p| p.parse())?)
} else {
None
};
Ok(ComponentExport {
span,
id,
debug_name,
name,
kind,
ty,
})
}
}
/// The kind of exported item. #[derive(Debug)] pubenum ComponentExportKind<'a> { /// The export is a core module. /// /// Note this isn't a core item ref as currently only /// components can export core modules.
CoreModule(ItemRef<'a, kw::module>), /// The export is a function.
Func(ItemRef<'a, kw::func>), /// The export is a value.
Value(ItemRef<'a, kw::value>), /// The export is a type. Type(ItemRef<'a, kw::r#type>), /// The export is a component.
Component(ItemRef<'a, kw::component>), /// The export is an instance.
Instance(ItemRef<'a, kw::instance>),
}
/// A listing of inline `(export "foo" <url>)` statements on a WebAssembly /// component item in its textual format. #[derive(Debug, Default)] pubstruct InlineExport<'a> { /// The extra names to export an item as, if any. pub names: Vec<ComponentExternName<'a>>,
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.