organic/src/wasm/regular_link.rs
2023-12-29 12:49:43 -05:00

37 lines
806 B
Rust

use serde::Serialize;
use super::macros::to_wasm;
use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm;
use crate::types::RegularLink;
use crate::wasm::to_wasm::ToWasmStandardProperties;
use crate::wasm::WasmAstNode;
#[derive(Debug, Serialize)]
#[serde(tag = "ast_node")]
#[serde(rename = "org-data")]
pub struct WasmRegularLink {
standard_properties: WasmStandardProperties,
children: Vec<WasmAstNode>,
}
to_wasm!(
WasmRegularLink,
RegularLink<'s>,
original,
wasm_context,
standard_properties,
{
Ok(WasmRegularLink {
standard_properties,
children: Vec::new(),
})
}
);
impl Into<WasmAstNode> for WasmRegularLink {
fn into(self) -> WasmAstNode {
WasmAstNode::RegularLink(self)
}
}