pub struct ExpressionI(pub usize);
Expand description
An ExpressionI
represents an index into Slab.ps.exprs
.
It behaves much like a pointer or reference, but it is ‘safe’ (unlike a raw pointer) and is not managed by the Rust borrow checker (unlike a reference).
Tuple Fields§
§0: usize
Implementations§
Source§impl ExpressionI
impl ExpressionI
Sourcepub fn from(self, ps: &ParseSlab) -> &Expression
pub fn from(self, ps: &ParseSlab) -> &Expression
Gets an Expression reference from the ParseSlab.
This is actually just a convenience function built on top of
ParseSlab.get_expr
, but it enables you to perform the entire
parse/compile/eval process in one line without upsetting the Rust
borrow checker. (If you didn’t have this function, the borrow checker
would force you to split the process into at least two lines.)
Trait Implementations§
Source§impl Clone for ExpressionI
impl Clone for ExpressionI
Source§fn clone(&self) -> ExpressionI
fn clone(&self) -> ExpressionI
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ExpressionI
impl Debug for ExpressionI
Source§impl PartialEq for ExpressionI
impl PartialEq for ExpressionI
impl Copy for ExpressionI
impl StructuralPartialEq for ExpressionI
Auto Trait Implementations§
impl Freeze for ExpressionI
impl RefUnwindSafe for ExpressionI
impl Send for ExpressionI
impl Sync for ExpressionI
impl Unpin for ExpressionI
impl UnwindSafe for ExpressionI
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