pub struct SymbolInterner { /* private fields */ }Expand description
Allocates and interns fresh symbolic dimensions, and lowers DimExprs to
IR Dims.
A derived dimension that is neither a pure constant nor a bare symbol (e.g.
floor((d-k)/s)+1 where d is symbolic) cannot be stored in the IR’s
Dim enum. Such an expression is assigned a fresh symbol; because
DimExpr is canonical, two structurally-identical derived dimensions
intern to the same symbol and stay unified across the graph.
Implementations§
Source§impl SymbolInterner
impl SymbolInterner
Sourcepub fn new(next: u32) -> Self
pub fn new(next: u32) -> Self
A new interner that allocates symbol ids starting at next (which must
be greater than every symbol id already present in the graph).
Sourcepub fn fresh_symbol(&mut self) -> SymbolId
pub fn fresh_symbol(&mut self) -> SymbolId
Mint a brand-new opaque symbol (not tied to any expression).
Sourcepub fn fresh_symbols(&self) -> &[SymbolId]
pub fn fresh_symbols(&self) -> &[SymbolId]
The symbols minted during inference (to register on the graph).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SymbolInterner
impl RefUnwindSafe for SymbolInterner
impl Send for SymbolInterner
impl Sync for SymbolInterner
impl Unpin for SymbolInterner
impl UnsafeUnpin for SymbolInterner
impl UnwindSafe for SymbolInterner
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