Sha256: 07b8cae3a400e1955cc39d142569910b4fef2136021053d0ddbd6404d810aa52
Contents?: true
Size: 770 Bytes
Versions: 54
Compression:
Stored size: 770 Bytes
Contents
use crate::{Component, ComponentSection, ComponentSectionId, Encode}; /// 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
54 entries across 38 versions & 1 rubygems