/// Represents the possible type bounds for type references. #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pubenum TypeBounds { /// The type is bounded by equality to the type index specified.
Eq(u32), /// This type is a fresh resource type,
SubResource,
}
/// Represents a reference to a type. #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pubenum ComponentTypeRef { /// The reference is to a core module type. /// /// The index is expected to be core type index to a core module type.
Module(u32), /// The reference is to a function type. /// /// The index is expected to be a type index to a function type.
Func(u32), /// The reference is to a value type.
Value(ComponentValType), /// The reference is to a bounded type. Type(TypeBounds), /// The reference is to an instance type. /// /// The index is expected to be a type index to an instance type.
Instance(u32), /// The reference is to a component type. /// /// The index is expected to be a type index to a component type.
Component(u32),
}
impl ComponentTypeRef { /// Gets the export kind of the reference. pubfn kind(&self) -> ComponentExportKind { matchself { Self::Module(_) => ComponentExportKind::Module, Self::Func(_) => ComponentExportKind::Func, Self::Value(_) => ComponentExportKind::Value, Self::Type(..) => ComponentExportKind::Type, Self::Instance(_) => ComponentExportKind::Instance, Self::Component(_) => ComponentExportKind::Component,
}
}
}
/// Prior to WebAssembly/component-model#263 import and export names were /// discriminated with a leading byte indicating what kind of import they are. /// After that PR though names are always prefixed with a 0x00 byte. /// /// On 2023-10-28 in bytecodealliance/wasm-tools#1262 was landed to start /// transitioning to "always lead with 0x00". That updated the validator/parser /// to accept either 0x00 or 0x01 but the encoder wasn't updated at the time. /// /// On 2024-09-03 in bytecodealliance/wasm-tools#TODO this encoder was updated /// to always emit 0x00 as a leading byte. /// /// This function corresponds with the `importname'` production in the /// specification. pub(crate) fn encode_component_import_name(bytes: &mut Vec<u8>, name: &str) {
bytes.push(0x00);
name.encode(bytes);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-06-18)
¤
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.