Sha256: 9e80907e72360fae4d8057b6b0e7a6b58edd7ba6aba6e63ba17346518e169617
Contents?: true
Size: 722 Bytes
Versions: 54
Compression:
Stored size: 722 Bytes
Contents
use crate::{ComponentSection, ComponentSectionId, Encode, Module}; /// An encoder for the module section of WebAssembly components. /// /// # Example /// /// ```rust /// use wasm_encoder::{Module, Component, ModuleSection}; /// /// let mut module = Module::new(); /// let mut component = Component::new(); /// component.section(&ModuleSection(&module)); /// /// let bytes = component.finish(); /// ``` #[derive(Clone, Debug)] pub struct ModuleSection<'a>(pub &'a Module); impl Encode for ModuleSection<'_> { fn encode(&self, sink: &mut Vec<u8>) { self.0.bytes.encode(sink); } } impl ComponentSection for ModuleSection<'_> { fn id(&self) -> u8 { ComponentSectionId::CoreModule.into() } }
Version data entries
54 entries across 38 versions & 1 rubygems