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.
This commit is contained in:
@@ -8,7 +8,7 @@ macro_rules! inoop {
|
||||
|
||||
impl $istruct {
|
||||
pub(crate) async fn new<'reg, 'orig, 'parse>(
|
||||
_registry: crate::intermediate::RefRegistry<'orig, 'parse>,
|
||||
_intermediate_context: crate::intermediate::IntermediateContext<'orig, 'parse>,
|
||||
_original: &'orig organic::types::$pstruct<'parse>,
|
||||
) -> Result<$istruct, CustomError> {
|
||||
Ok($istruct {})
|
||||
@@ -23,10 +23,10 @@ pub(crate) use inoop;
|
||||
///
|
||||
/// This exists to make changing the type signature easier.
|
||||
macro_rules! intermediate {
|
||||
($istruct:ident, $pstruct:ty, $original:ident, $registry:ident, $fnbody:tt) => {
|
||||
($istruct:ident, $pstruct:ty, $original:ident, $intermediate_context:ident, $fnbody:tt) => {
|
||||
impl $istruct {
|
||||
pub(crate) async fn new<'orig, 'parse>(
|
||||
$registry: crate::intermediate::RefRegistry<'orig, 'parse>,
|
||||
$intermediate_context: crate::intermediate::IntermediateContext<'orig, 'parse>,
|
||||
$original: $pstruct,
|
||||
) -> Result<$istruct, CustomError> {
|
||||
$fnbody
|
||||
@@ -41,14 +41,12 @@ pub(crate) use intermediate;
|
||||
///
|
||||
/// This exists to make changing the type signature easier.
|
||||
macro_rules! iselector {
|
||||
($istruct:ident, $pstruct:ident, $original:ident, $registry:ident, $fnbody:tt) => {
|
||||
($istruct:ident, $pstruct:ident, $original:ident, $intermediate_context:ident, $fnbody:tt) => {
|
||||
impl $istruct {
|
||||
pub(crate) fn new<'orig, 'parse>(
|
||||
registry: crate::intermediate::RefRegistry<'orig, 'parse>,
|
||||
original: &'orig organic::types::$pstruct<'parse>,
|
||||
$intermediate_context: crate::intermediate::IntermediateContext<'orig, 'parse>,
|
||||
$original: &'orig organic::types::$pstruct<'parse>,
|
||||
) -> BoxFuture<'orig, Result<$istruct, CustomError>> {
|
||||
let $registry = registry;
|
||||
let $original = original;
|
||||
async move { $fnbody }.boxed()
|
||||
}
|
||||
}
|
||||
@@ -58,11 +56,11 @@ macro_rules! iselector {
|
||||
pub(crate) use iselector;
|
||||
|
||||
macro_rules! iitem {
|
||||
($registry:expr, $original:expr, $(($penum:path, $ienum:path, $istruct:ident),)*) => {
|
||||
($intermediate_context:expr, $original:expr, $(($penum:path, $ienum:path, $istruct:ident),)*) => {
|
||||
match $original {
|
||||
$(
|
||||
$penum(inner) => Ok($ienum(
|
||||
$istruct::new($registry.clone(), inner).await?,
|
||||
$istruct::new($intermediate_context.clone(), inner).await?,
|
||||
)),
|
||||
)*
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user