Trait wasm_encoder::component::ComponentSection[][src]

pub trait ComponentSection {
    fn id(&self) -> u8;
fn encode<S>(&self, sink: &mut S)
    where
        S: Extend<u8>
; }
Expand description

A WebAssembly component section.

This trait marks sections that can be written to a Component.

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

This section’s id.

See SectionId for known section ids.

Write this section’s data and data length prefix into the given sink.

Implementors