/// A WebAssembly global in a module #[derive(Debug)] pubstruct Global<'a> { /// Where this `global` was defined. pub span: Span, /// An optional name to reference this global by pub id: Option<Id<'a>>, /// An optional name for this function stored in the custom `name` section. pub name: Option<NameAnnotation<'a>>, /// If present, inline export annotations which indicate names this /// definition should be exported under. pub exports: InlineExport<'a>, /// The type of this global, both its value type and whether it's mutable. pub ty: GlobalType<'a>, /// What kind of global this defined as. pub kind: GlobalKind<'a>,
}
/// Different kinds of globals that can be defined in a module. #[derive(Debug)] pubenum GlobalKind<'a> { /// A global which is actually defined as an import, such as: /// /// ```text /// (global i32 (import "foo" "bar")) /// ```
Import(InlineImport<'a>),
/// A global defined inline in the module itself
Inline(Expression<'a>),
}
impl<'a> Parse<'a> for Global<'a> { fn parse(parser: Parser<'a>) -> Result<Self> { let span = parser.parse::<kw::global>()?.0; let id = parser.parse()?; let name = parser.parse()?; let exports = parser.parse()?;
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.