2023-12-25 11:33:43 -05:00
|
|
|
use serde::Serialize;
|
|
|
|
|
2023-12-25 12:55:48 -05:00
|
|
|
use super::ast_node::WasmAstNode;
|
2023-12-25 11:33:43 -05:00
|
|
|
use super::macros::to_wasm;
|
|
|
|
use super::standard_properties::WasmStandardProperties;
|
|
|
|
use super::to_wasm::ToWasm;
|
2023-12-27 11:36:47 -05:00
|
|
|
use crate::types::Heading;
|
2023-12-25 11:33:43 -05:00
|
|
|
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
|
|
|
|
2023-12-25 12:42:38 -05:00
|
|
|
#[derive(Debug, Serialize)]
|
2023-12-25 11:33:43 -05:00
|
|
|
#[serde(tag = "ast_node")]
|
2023-12-25 12:55:48 -05:00
|
|
|
#[serde(rename = "headline")]
|
2023-12-29 12:49:43 -05:00
|
|
|
pub struct WasmHeadline {
|
2023-12-25 11:33:43 -05:00
|
|
|
standard_properties: WasmStandardProperties,
|
2023-12-29 12:49:43 -05:00
|
|
|
children: Vec<WasmAstNode>,
|
2023-12-25 11:33:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
to_wasm!(
|
2023-12-29 12:49:43 -05:00
|
|
|
WasmHeadline,
|
2023-12-25 11:51:39 -05:00
|
|
|
Heading<'s>,
|
2023-12-25 12:32:35 -05:00
|
|
|
original,
|
2023-12-25 11:33:43 -05:00
|
|
|
wasm_context,
|
|
|
|
standard_properties,
|
|
|
|
{
|
2023-12-25 11:51:39 -05:00
|
|
|
Ok(WasmHeadline {
|
2023-12-25 11:33:43 -05:00
|
|
|
standard_properties,
|
|
|
|
children: Vec::new(),
|
|
|
|
})
|
|
|
|
}
|
|
|
|
);
|
2023-12-25 12:55:48 -05:00
|
|
|
|
2023-12-29 12:49:43 -05:00
|
|
|
impl Into<WasmAstNode> for WasmHeadline {
|
|
|
|
fn into(self) -> WasmAstNode {
|
2023-12-25 12:55:48 -05:00
|
|
|
WasmAstNode::Headline(self)
|
|
|
|
}
|
|
|
|
}
|