Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/wasm-encoder/src/component/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 722 B image not shown  

Quelle  modules.rs   Sprache: unbekannt

 
Spracherkennung für: .rs vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

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()
    }
}

[ Dauer der Verarbeitung: 0.33 Sekunden  ]