Sha256: 5813a426bcef495f89c4744e0cca1fe20db3150998ce591d7b3c01dc30ca9e13

Contents?: true

Size: 677 Bytes

Versions: 4

Compression:

Stored size: 677 Bytes

Contents

use crate::{Encode, Section};
use alloc::vec::Vec;

/// A section made up of uninterpreted, raw bytes.
///
/// Allows you to splat any data into a module or component.
#[derive(Clone, Copy, Debug)]
pub struct RawSection<'a> {
    /// The id for this section.
    pub id: u8,
    /// The raw data for this section.
    pub data: &'a [u8],
}

impl Encode for RawSection<'_> {
    fn encode(&self, sink: &mut Vec<u8>) {
        self.data.encode(sink);
    }
}

impl Section for RawSection<'_> {
    fn id(&self) -> u8 {
        self.id
    }
}

#[cfg(feature = "component-model")]
impl crate::ComponentSection for RawSection<'_> {
    fn id(&self) -> u8 {
        self.id
    }
}

Version data entries

4 entries across 3 versions & 1 rubygems

Version Path
wasmtime-30.0.2 ./ext/cargo-vendor/wasm-encoder-0.224.1/src/raw.rs
wasmtime-30.0.2 ./ext/cargo-vendor/wasm-encoder-0.226.0/src/raw.rs
wasmtime-29.0.0 ./ext/cargo-vendor/wasm-encoder-0.224.0/src/raw.rs
wasmtime-28.0.0 ./ext/cargo-vendor/wasm-encoder-0.223.0/src/raw.rs