organic/src/wasm/document.rs

34 lines
756 B
Rust
Raw Normal View History

2023-12-25 11:19:09 -05:00
use std::marker::PhantomData;
2023-12-24 01:35:21 -05:00
use organic::types::Document;
use serde::Deserialize;
use serde::Serialize;
2023-12-24 13:18:06 -05:00
use super::macros::to_wasm;
2023-12-24 15:48:33 -05:00
use super::standard_properties::WasmStandardProperties;
use super::to_wasm::ToWasm;
use crate::wasm::to_wasm::ToWasmStandardProperties;
2023-12-24 13:18:06 -05:00
2023-12-24 01:35:21 -05:00
#[derive(Serialize, Deserialize)]
#[serde(tag = "ast_node")]
#[serde(rename = "org-data")]
2023-12-25 11:19:09 -05:00
pub(crate) struct WasmDocument<'s> {
2023-12-24 15:48:33 -05:00
standard_properties: WasmStandardProperties,
2023-12-24 13:18:06 -05:00
children: Vec<()>,
2023-12-25 11:19:09 -05:00
phantom: PhantomData<&'s ()>,
2023-12-24 13:18:06 -05:00
}
2023-12-24 01:35:21 -05:00
2023-12-24 15:48:33 -05:00
to_wasm!(
2023-12-25 11:19:09 -05:00
WasmDocument<'s>,
2023-12-24 15:48:33 -05:00
Document<'s>,
wasm_context,
standard_properties,
{
Ok(WasmDocument {
standard_properties,
children: Vec::new(),
2023-12-25 11:19:09 -05:00
phantom: PhantomData,
2023-12-24 15:48:33 -05:00
})
2023-12-24 01:35:21 -05:00
}
2023-12-24 15:48:33 -05:00
);