natter/src/intermediate/intermediate_context.rs
Tom Alexander 8b85c02ef1
Wrap the intermediate Registry in an IntermediateContext.
This is currently just to maintain consistency with the render phase's RenderContext but in the future it should allow us to include immutable data that is not locked behind the ArcMutex.
2023-12-21 13:53:56 -05:00

16 lines
602 B
Rust

use crate::error::CustomError;
/// The supporting information used for converting the parsed org source representation into the intermediate representation used in this project.
#[derive(Debug, Clone)]
pub(crate) struct IntermediateContext<'orig, 'parse> {
pub(crate) registry: crate::intermediate::RefRegistry<'orig, 'parse>,
}
impl<'orig, 'parse> IntermediateContext<'orig, 'parse> {
pub(crate) fn new(
registry: crate::intermediate::RefRegistry<'orig, 'parse>,
) -> Result<IntermediateContext<'orig, 'parse>, CustomError> {
Ok(IntermediateContext { registry })
}
}