pub struct Expand {
pub expr_map: HashMap<usize, Expr<()>>,
pub math: Math,
pub rc_keepalive: Vec<Rc<dyn Any>>,
}
Expand description
A context struct for loading unrolled data.
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
Sourcepub fn load<T: Displayed + GetMathType + Debug + GetData + 'static>(
&mut self,
unrolled: &Unrolled<T>,
) -> VarIndexwhere
ExprKind: FromUnrolled<T>,
pub fn load<T: Displayed + GetMathType + Debug + GetData + 'static>(
&mut self,
unrolled: &Unrolled<T>,
) -> VarIndexwhere
ExprKind: FromUnrolled<T>,
Load an unrolled expression. Also stores it in the variable record.
Sourcepub fn load_no_store<T: Displayed + GetMathType + GetData + Debug + 'static>(
&mut self,
unrolled: &Unrolled<T>,
) -> ExprKindwhere
ExprKind: FromUnrolled<T>,
pub fn load_no_store<T: Displayed + GetMathType + GetData + Debug + 'static>(
&mut self,
unrolled: &Unrolled<T>,
) -> ExprKindwhere
ExprKind: FromUnrolled<T>,
Load an unrolled expression without storing it.
Methods from Deref<Target = Math>§
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§impl<T> CloneWithNode for Twhere
T: Clone,
impl<T> CloneWithNode for Twhere
T: Clone,
Source§fn clone_with_node(&mut self) -> T
fn clone_with_node(&mut self) -> T
Clone
self
and take its node.Source§fn clone_without_node(&self) -> T
fn clone_without_node(&self) -> T
Clone
self
without taking its node.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>,
Convert
self
into a specific type. Read moreSource§fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
Check if
self
can be converted into a specific type. Read more