41 lines
908 B
Rust
41 lines
908 B
Rust
use std::marker::PhantomData;
|
|
|
|
use crate::types::Heading;
|
|
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 = "headline")]
|
|
pub(crate) struct WasmHeadline<'s> {
|
|
standard_properties: WasmStandardProperties,
|
|
children: Vec<()>,
|
|
phantom: PhantomData<&'s ()>,
|
|
}
|
|
|
|
to_wasm!(
|
|
WasmHeadline<'s>,
|
|
Heading<'s>,
|
|
original,
|
|
wasm_context,
|
|
standard_properties,
|
|
{
|
|
Ok(WasmHeadline {
|
|
standard_properties,
|
|
children: Vec::new(),
|
|
phantom: PhantomData,
|
|
})
|
|
}
|
|
);
|
|
|
|
impl<'s> Into<WasmAstNode<'s>> for WasmHeadline<'s> {
|
|
fn into(self) -> WasmAstNode<'s> {
|
|
WasmAstNode::Headline(self)
|
|
}
|
|
}
|