wasm_encoder

Trait Section

Source
pub trait Section: Encode {
    // Required method
    fn id(&self) -> u8;

    // Provided method
    fn append_to(&self, dst: &mut Vec<u8>) { ... }
}
Expand description

A WebAssembly module 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§

Source

fn id(&self) -> u8

Gets the section identifier for this section.

Provided Methods§

Source

fn append_to(&self, dst: &mut Vec<u8>)

Appends this section to the specified destination list of bytes.

Implementors§