use std::marker::PhantomData; use serde::Serialize; use super::ast_node::WasmAstNode; use super::macros::to_wasm; use super::standard_properties::WasmStandardProperties; use super::to_wasm::ToWasm; use crate::types::Section; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize)] #[serde(tag = "ast_node")] #[serde(rename = "section")] pub(crate) struct WasmSection<'s, 'p> { standard_properties: WasmStandardProperties, children: Vec<()>, phantom: PhantomData<&'s ()>, } to_wasm!( WasmSection<'s, 'p>, Section<'s>, original, wasm_context, standard_properties, { Ok(WasmSection { standard_properties, children: Vec::new(), phantom: PhantomData, }) } ); impl<'s, 'p> Into> for WasmSection<'s, 'p> { fn into(self) -> WasmAstNode<'s, 'p> { WasmAstNode::Section(self) } }