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