pub struct SLTNodeFacts<'arena, A: Hash + Eq + Clone> { /* private fields */ }Expand description
Width facts for every node in an SLTNodeArena.
Construction verifies the complete dependency graph before computing any widths. The implementation is iterative so malformed cycles and very deep expression graphs cannot overflow the Rust call stack.
Implementations§
Source§impl<'arena, A> SLTNodeFacts<'arena, A>
impl<'arena, A> SLTNodeFacts<'arena, A>
Sourcepub fn verify(arena: &'arena SLTNodeArena<A>) -> Result<Self, SLTNodeFactsError>
pub fn verify(arena: &'arena SLTNodeArena<A>) -> Result<Self, SLTNodeFactsError>
Verify arena and compute one width for every node.
Sourcepub fn width(&self, node: NodeId) -> Option<usize>
pub fn width(&self, node: NodeId) -> Option<usize>
Return the verified width of node, or None when the ID does not
belong to the arena from which this table was built.
Sourcepub fn require_width(
&self,
node: NodeId,
role: &'static str,
) -> Result<usize, SLTNodeFactsError>
pub fn require_width( &self, node: NodeId, role: &'static str, ) -> Result<usize, SLTNodeFactsError>
Return a verified root width, diagnosing a root that does not belong to the arena instead of allowing a later unchecked lookup to panic.
Sourcepub fn require_lowerable(
&self,
node: NodeId,
role: &'static str,
) -> Result<usize, SLTNodeFactsError>
pub fn require_lowerable( &self, node: NodeId, role: &'static str, ) -> Result<usize, SLTNodeFactsError>
Require a root and every node reachable from it to be lowerable to nonzero-width executable IR.
Trait Implementations§
Auto Trait Implementations§
impl<'arena, A> Freeze for SLTNodeFacts<'arena, A>where
&'arena SLTNodeArena<A>: Freeze,
impl<'arena, A> RefUnwindSafe for SLTNodeFacts<'arena, A>where
&'arena SLTNodeArena<A>: RefUnwindSafe,
impl<'arena, A> Send for SLTNodeFacts<'arena, A>where
&'arena SLTNodeArena<A>: Send,
impl<'arena, A> Sync for SLTNodeFacts<'arena, A>where
&'arena SLTNodeArena<A>: Sync,
impl<'arena, A> Unpin for SLTNodeFacts<'arena, A>where
&'arena SLTNodeArena<A>: Unpin,
impl<'arena, A> UnsafeUnpin for SLTNodeFacts<'arena, A>where
&'arena SLTNodeArena<A>: UnsafeUnpin,
impl<'arena, A> UnwindSafe for SLTNodeFacts<'arena, A>where
&'arena SLTNodeArena<A>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more