use serde::Serialize; use super::angle_link::WasmAngleLink; use super::babel_call::WasmBabelCall; use super::bold::WasmBold; use super::center_block::WasmCenterBlock; use super::citation::WasmCitation; use super::citation_reference::WasmCitationReference; use super::clock::WasmClock; use super::code::WasmCode; use super::comment::WasmComment; use super::comment_block::WasmCommentBlock; use super::diary_sexp::WasmDiarySexp; use super::document::WasmDocument; use super::drawer::WasmDrawer; use super::dynamic_block::WasmDynamicBlock; use super::entity::WasmEntity; use super::example_block::WasmExampleBlock; use super::export_block::WasmExportBlock; use super::export_snippet::WasmExportSnippet; use super::fixed_width_area::WasmFixedWidthArea; use super::footnote_definition::WasmFootnoteDefinition; use super::footnote_reference::WasmFootnoteReference; use super::headline::WasmHeadline; use super::horizontal_rule::WasmHorizontalRule; use super::inline_babel_call::WasmInlineBabelCall; use super::inline_source_block::WasmInlineSourceBlock; use super::italic::WasmItalic; use super::keyword::WasmKeyword; use super::latex_environment::WasmLatexEnvironment; use super::latex_fragment::WasmLatexFragment; use super::line_break::WasmLineBreak; use super::node_property::WasmNodeProperty; use super::org_macro::WasmOrgMacro; use super::paragraph::WasmParagraph; use super::plain_link::WasmPlainLink; use super::plain_list::WasmPlainList; use super::plain_list_item::WasmPlainListItem; use super::plain_text::WasmPlainText; use super::planning::WasmPlanning; use super::property_drawer::WasmPropertyDrawer; use super::quote_block::WasmQuoteBlock; use super::radio_link::WasmRadioLink; use super::radio_target::WasmRadioTarget; use super::regular_link::WasmRegularLink; use super::section::WasmSection; use super::special_block::WasmSpecialBlock; use super::src_block::WasmSrcBlock; use super::statistics_cookie::WasmStatisticsCookie; use super::strike_through::WasmStrikeThrough; use super::subscript::WasmSubscript; use super::superscript::WasmSuperscript; use super::table::WasmTable; use super::table_cell::WasmTableCell; use super::table_row::WasmTableRow; use super::target::WasmTarget; use super::timestamp::WasmTimestamp; use super::underline::WasmUnderline; use super::verbatim::WasmVerbatim; use super::verse_block::WasmVerseBlock; // #[derive(Debug, Serialize)] // pub(crate) struct WasmAstWrapper<'b, 's, 'p, I> { // #[serde(rename = "ast-node")] // pub(crate) ast_node: Cow<'static, str>, // #[serde(rename = "standard-properties")] // pub(crate) standard_properties: WasmStandardProperties, // #[serde(rename = "properties")] // pub(crate) inner: I, // pub(crate) children: &'b Vec>, // } // impl<'b, 's, 'p, I> WasmAstWrapper<'b, 's, 'p, I> { // pub(crate) fn new( // ast_node: Cow<'s, str>, // standard_properties: &'b WasmStandardProperties, // inner: I, // children: &'b Vec>, // ) -> WasmAstWrapper<'b, 's, 'p, I> { // WasmAstWrapper { // ast_node, // standard_properties, // inner, // children, // } // } // } #[derive(Debug, Serialize)] #[serde(untagged)] pub enum WasmAstNode { // Document Nodes Document(WasmDocument), Headline(WasmHeadline), Section(WasmSection), // Elements Paragraph(WasmParagraph), PlainList(WasmPlainList), PlainListItem(WasmPlainListItem), CenterBlock(WasmCenterBlock), QuoteBlock(WasmQuoteBlock), SpecialBlock(WasmSpecialBlock), DynamicBlock(WasmDynamicBlock), FootnoteDefinition(WasmFootnoteDefinition), Comment(WasmComment), Drawer(WasmDrawer), PropertyDrawer(WasmPropertyDrawer), NodeProperty(WasmNodeProperty), Table(WasmTable), TableRow(WasmTableRow), VerseBlock(WasmVerseBlock), CommentBlock(WasmCommentBlock), ExampleBlock(WasmExampleBlock), ExportBlock(WasmExportBlock), SrcBlock(WasmSrcBlock), Clock(WasmClock), DiarySexp(WasmDiarySexp), Planning(WasmPlanning), FixedWidthArea(WasmFixedWidthArea), HorizontalRule(WasmHorizontalRule), Keyword(WasmKeyword), BabelCall(WasmBabelCall), LatexEnvironment(WasmLatexEnvironment), // Objects Bold(WasmBold), Italic(WasmItalic), Underline(WasmUnderline), StrikeThrough(WasmStrikeThrough), Code(WasmCode), Verbatim(WasmVerbatim), PlainText(WasmPlainText), RegularLink(WasmRegularLink), RadioLink(WasmRadioLink), RadioTarget(WasmRadioTarget), PlainLink(WasmPlainLink), AngleLink(WasmAngleLink), OrgMacro(WasmOrgMacro), Entity(WasmEntity), LatexFragment(WasmLatexFragment), ExportSnippet(WasmExportSnippet), FootnoteReference(WasmFootnoteReference), Citation(WasmCitation), CitationReference(WasmCitationReference), InlineBabelCall(WasmInlineBabelCall), InlineSourceBlock(WasmInlineSourceBlock), LineBreak(WasmLineBreak), Target(WasmTarget), StatisticsCookie(WasmStatisticsCookie), Subscript(WasmSubscript), Superscript(WasmSuperscript), TableCell(WasmTableCell), Timestamp(WasmTimestamp), } impl WasmAstNode {}