pub fn lazy_hir<I, R>(&self, id: I) -> Result<&'ctx R>
    where
        I: Copy + Debug,
        R: Debug + 'ctx,
        LazyHirTable<'sb, 'ast, 'ctx>: NodeStorage<
            I,
            Node = LazyNode<
                Box<for<'a, 'b> Fn(&'a ScoreContext<'b, 'sb, 'ast, 'ctx>) -> Result<R> + 'sb>,
            >,
        >,
        HirTable<'ctx>: NodeStorage<I, Node = &'ctx R>,
        hir::Arenas: Alloc<'ctx, 'ctx, R>,
    {
        // If the HIR has already been determined, return it immediately.
        if let Some(&node) = self.sb.hir_table.borrow().get(&id) {
            return Ok(node);
        }

        // Otherwise run the task scheduled in the lazy HIR table, then store
        // the result.
        let hir = self.lazy.hir.run(id, self)?;
        let allocd = self.sb.arenas.hir.alloc(hir);
        self.sb.hir_table.borrow_mut().set(id, allocd);

        Ok(allocd)
    }
/// Determine the HIR for a node.
///
/// If the HIR is already in the scoreboard, returns it immediately.
/// Otherwise the lazy HIR table is triggered which will compute the HIR via
/// the corresponding closure.
Determine the HIR for a node.
If the HIR is already in the scoreboard, returns it immediately.
Otherwise the lazy HIR table is triggered which will compute the HIR via
the corresponding closure.
Determine the HIR for a node . If the HIR is already in the scoreboard returns it immediately . Otherwise the lazy HIR table is triggered which will compute the HIR via the corresponding closure .
pub fn lazy_hir<I, R>(&self, id: I) -> Result<&'ctx R>
    where
        I: Copy + Debug,
        R: Debug + 'ctx,
        LazyHirTable<'sb, 'ast, 'ctx>: NodeStorage<
            I,
            Node = LazyNode<
                Box<for<'a, 'b> Fn(&'a ScoreContext<'b, 'sb, 'ast, 'ctx>) -> Result<R> + 'sb>,
            >,
        >,
        HirTable<'ctx>: NodeStorage<I, Node = &'ctx R>,
        hir::Arenas: Alloc<'ctx, 'ctx, R>,
    {
        // If the HIR has already been determined, return it immediately.
        if let Some(&node) = self.sb.hir_table.borrow().get(&id) {
            return Ok(node);
        }
        // Otherwise run the task scheduled in the lazy HIR table, then store
        // the result.
        let hir = self.lazy.hir.run(id, self)?;
        let allocd = self.sb.arenas.hir.alloc(hir);
        self.sb.hir_table.borrow_mut().set(id, allocd);
        Ok(allocd)
    }
pub fn lazy_hir < I , R > ( & self , id : I ) -> Result < & ' ctx R > where I : Copy + Debug , R : Debug + ' ctx , LazyHirTable < ' sb , ' ast , ' ctx > : NodeStorage < I , Node = LazyNode < Box < for < ' a , ' b > Fn ( & ' a ScoreContext < ' b , ' sb , ' ast , ' ctx > ) -> Result < R > + ' sb > , > , > , HirTable < ' ctx > : NodeStorage < I , Node = & ' ctx R > , hir :: Arenas : Alloc < ' ctx , ' ctx , R > , { // If the HIR has already been determined, return it immediately. if let Some ( & node ) = self . sb . hir_table . borrow ( ) . get ( & id ) { return Ok ( node ) ; } // Otherwise run the task scheduled in the lazy HIR table, then store // the result. let hir = self . lazy . hir . run ( id , self ) ? ; let allocd = self . sb . arenas . hir . alloc ( hir ) ; self . sb . hir_table . borrow_mut ( ) . set ( id , allocd ) ; Ok ( allocd ) }
Determine the HIR for a node.
Determine the HIR for a node .
&self
id
I
&self
id
I