organic/src/wasm/section.rs
Tom Alexander e499169f0e
Some checks failed
clippy Build clippy has failed
rust-build Build rust-build has failed
rust-foreign-document-test Build rust-foreign-document-test has succeeded
rust-test Build rust-test has succeeded
Fix imports for wasm_test.
2023-12-27 08:37:34 -05:00

41 lines
902 B
Rust

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