pub trait ComponentSection: Encode {
// Required method
fn id(&self) -> u8;
// Provided method
fn append_to_component(&self, dst: &mut Vec<u8>) { ... }
}Expand description
A WebAssembly component section.
Various builders defined in this crate already implement this trait, but you
can also implement it yourself for your own custom section builders, or use
RawSection to use a bunch of raw bytes as a section.
Required Methods§
Provided Methods§
Sourcefn append_to_component(&self, dst: &mut Vec<u8>)
fn append_to_component(&self, dst: &mut Vec<u8>)
Appends this section to the specified destination list of bytes.
Implementors§
impl ComponentSection for CanonicalFunctionSection
impl ComponentSection for ComponentAliasSection
impl ComponentSection for ComponentExportSection
impl ComponentSection for ComponentImportSection
impl ComponentSection for ComponentInstanceSection
impl ComponentSection for ComponentNameSection
impl ComponentSection for ComponentTypeSection
impl ComponentSection for CoreTypeSection
impl ComponentSection for CustomSection<'_>
impl ComponentSection for InstanceSection
impl ComponentSection for ModuleSection<'_>
impl ComponentSection for NestedComponentSection<'_>
impl ComponentSection for ProducersSection
impl ComponentSection for RawCustomSection<'_>
impl ComponentSection for RawSection<'_>
Available on crate feature
component-model only.