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