Enum rhai::Expr [−][src]
(INTERNALS) An expression sub-tree.
Exported under the internals
feature only.
Volatile Data Structure
This type is volatile and may change.
Variants
Dynamic constant.
Used to hold either an Array
or Map
literal for quick cloning.
All other primitive data types should use the appropriate variants for better speed.
Boolean constant.
Integer constant.
FloatConstant(FloatWrapper, Position)
Floating-point constant.
Character constant.
StringConstant(ImmutableString, Position)
String constant.
FnPointer(ImmutableString, Position)
FnPtr
constant.
[ expr, … ]
#{ name:expr, … }
Unit(Position)
()
Variable access - (optional index, optional (hash, modules), variable name)
Property access - ((getter, hash), (setter, hash), prop)
{ statement … }
FnCall(Box<FnCallExpr>, Position)
func (
expr ,
… )
Dot(Box<BinaryExpr>, Position)
lhs .
rhs
Index(Box<BinaryExpr>, Position)
expr [
expr ]
And(Box<BinaryExpr>, Position)
lhs &&
rhs
Or(Box<BinaryExpr>, Position)
lhs ||
rhs
Custom(Box<CustomExpr>, Position)
Custom syntax
Implementations
impl Expr
[src]
pub fn get_constant_value(&self) -> Option<Dynamic>
[src]
pub fn position(&self) -> Position
[src]
Get the position of the expression.
pub fn set_position(&mut self, new_pos: Position) -> &mut SelfⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
Override the position of the expression.
pub fn is_pure(&self) -> bool
[src]
Is the expression pure?
A pure expression has no side effects.
pub fn is_unit(&self) -> bool
[src]
Is the expression the unit ()
literal?
pub fn is_constant(&self) -> bool
[src]
Is the expression a constant?
pub fn is_valid_postfix(&self, token: &Token) -> bool
[src]
Is a particular token allowed as a postfix operator to this expression?
pub fn walk<'a>(
&'a self,
path: &mut Vec<ASTNode<'a>>,
on_node: &mut impl FnMut(&[ASTNode<'_>]) -> bool
) -> bool
[src]
&'a self,
path: &mut Vec<ASTNode<'a>>,
on_node: &mut impl FnMut(&[ASTNode<'_>]) -> bool
) -> bool
Recursively walk this expression.
Return false
from the callback to terminate the walk.
Trait Implementations
impl Clone for Expr
[src]
impl Debug for Expr
[src]
impl Default for Expr
[src]
impl<'a> From<&'a Expr> for ASTNode<'a>
[src]
impl<'a> From<&'a Expr> for Expression<'a>
[src]
impl Hash for Expr
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Expr
impl !Send for Expr
impl !Sync for Expr
impl Unpin for Expr
impl !UnwindSafe for Expr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
impl<T> CallHasher for T where
T: Hash + ?Sized,
[src]
T: Hash + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,