pub struct Expand {
pub expr_map: HashMap<usize, Expr<()>>,
pub math: Math,
pub rc_keepalive: Vec<Rc<dyn Any>>,
}
Fields§
§expr_map: HashMap<usize, Expr<()>>
Expressions are mapped to the record entries.
math: Math
Processing context
rc_keepalive: Vec<Rc<dyn Any>>
Used to keep pointers with the data we need alive, so that no memory issues occur.
Normally, an address add to expr_map
as a key had the risk of expiring and a collision
occurring. This way, this should be prevented. It will also increase memory usage, but shhh.
It’s an ugly solution, but it works. I’m most likely going to come back to this one with some
new ideas for solving the issue.
Implementations§
source§impl Expand
impl Expand
pub fn load<T: Displayed + GetMathType + Debug + GetData + 'static>(
&mut self,
unrolled: &Unrolled<T>,
) -> VarIndexwhere
ExprKind: FromUnrolled<T>,
pub fn load_no_store<T: Displayed + GetMathType + GetData + Debug + 'static>(
&mut self,
unrolled: &Unrolled<T>,
) -> ExprKindwhere
ExprKind: FromUnrolled<T>,
Methods from Deref<Target = Math>§
pub fn store(&mut self, expr: ExprKind, ty: ExprType) -> VarIndex
pub fn compare(&self, a: VarIndex, b: VarIndex) -> Ordering
sourcepub fn get_dst_var(&mut self) -> VarIndex
pub fn get_dst_var(&mut self) -> VarIndex
§Panics
Will never.
pub fn at(&self, index: VarIndex) -> &Expr<()>
pub fn add_point(&mut self) -> EntityId
pub fn add_real(&mut self) -> EntityId
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Expand
impl !RefUnwindSafe for Expand
impl !Send for Expand
impl !Sync for Expand
impl Unpin for Expand
impl !UnwindSafe for Expand
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneWithNode for Twhere
T: Clone,
impl<T> CloneWithNode for Twhere
T: Clone,
fn clone_with_node(&mut self) -> T
fn clone_without_node(&self) -> T
source§impl<T> Convert for T
impl<T> Convert for T
source§fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
Errors Read more
source§fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
Errors Read more