use serde::Deserialize; use serde::Serialize; use super::ast_node::WasmAstNode; use super::macros::to_wasm; use super::to_wasm::ToWasm; use crate::types::RadioLink; use crate::util::elisp_fact::ElispFact; use crate::wasm::to_wasm::ToWasmStandardProperties; #[derive(Debug, Serialize, Deserialize)] #[serde(tag = "format")] #[serde(rename = "plain")] pub struct WasmRadioLink { #[serde(rename = "type")] pub(crate) link_type: String, pub(crate) path: String, #[serde(rename = "raw-link")] pub(crate) raw_link: String, pub(crate) application: Option, // Always None #[serde(rename = "search-option")] pub(crate) search_option: Option, // Always None } to_wasm!( WasmRadioLink, RadioLink<'s>, original, wasm_context, { WasmAstNode::RadioLink(original) }, { "link".into() }, { let children = original .children .iter() .map(|child| { child .to_wasm(wasm_context.clone()) .map(Into::::into) }) .collect::, _>>()?; Ok(( children, WasmRadioLink { link_type: "radio".to_owned(), path: original.path.to_owned(), raw_link: original.get_raw_link().to_owned(), application: None, search_option: None, }, )) } );