Separate out rust parsing step to support references to values stored in the parsed state.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
use crate::error::CustomError;
|
||||
|
||||
pub(crate) trait ToWasm {
|
||||
pub trait ToWasm<'p> {
|
||||
type Output;
|
||||
|
||||
fn to_wasm(&self, full_document: ToWasmContext<'_>) -> Result<Self::Output, CustomError>;
|
||||
fn to_wasm(&'p self, full_document: ToWasmContext<'_>) -> Result<Self::Output, CustomError>;
|
||||
}
|
||||
|
||||
pub(crate) trait ToWasmStandardProperties {
|
||||
@@ -16,12 +16,12 @@ pub(crate) trait ToWasmStandardProperties {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct ToWasmContext<'s> {
|
||||
pub struct ToWasmContext<'s> {
|
||||
pub(crate) full_document: &'s str,
|
||||
}
|
||||
|
||||
impl<'s> ToWasmContext<'s> {
|
||||
pub(crate) fn new(full_document: &'s str) -> ToWasmContext<'s> {
|
||||
pub fn new(full_document: &'s str) -> ToWasmContext<'s> {
|
||||
ToWasmContext { full_document }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user