use crate::error::CustomError; pub trait ToWasm<'p> { type Output; fn to_wasm(&'p self, full_document: ToWasmContext<'_>) -> Result; } pub(crate) trait ToWasmStandardProperties { type Output; fn to_wasm_standard_properties( &self, wasm_context: ToWasmContext<'_>, ) -> Result; } #[derive(Debug, Clone)] pub struct ToWasmContext<'s> { pub(crate) full_document: &'s str, } impl<'s> ToWasmContext<'s> { pub fn new(full_document: &'s str) -> ToWasmContext<'s> { ToWasmContext { full_document } } }