[][src]Struct arcon::weld::ast::prelude::Expr

pub struct Expr {
    pub ty: Type,
    pub kind: ExprKind,
    pub annotations: Annotations,
}

A typed Weld expression tree.

Fields

ty: Typekind: ExprKindannotations: Annotations

Methods

impl Expr[src]

pub fn children(&self) -> IntoIter<&Expr>[src]

Get an iterator for the children of this expression.

pub fn children_mut(&mut self) -> IntoIter<&mut Expr>[src]

Get an iterator of mutable references to the children of this expression.

pub fn partially_typed(&self) -> bool[src]

Returns whether this Expr is partially typed.

A type is partial if it or any of its subtypes is Unknown.

pub fn substitute(&mut self, symbol: &Symbol, replacement: &Expr)[src]

Substitute Ident nodes with the given symbol for another expression, stopping when an expression in the tree redefines the symbol (e.g. Let or Lambda parameters).

pub fn traverse<F>(&self, func: &mut F) where
    F: FnMut(&Expr), 
[src]

Run a closure on this expression and every child, in pre-order.

pub fn contains_symbol(&self, sym: &Symbol) -> bool[src]

Returns true if this expression contains the symbol sym in an Ident.

pub fn transform_and_continue<F>(&mut self, func: &mut F) where
    F: FnMut(&mut Expr) -> (Option<Expr>, bool)
[src]

Recursively transforms an expression in place by running a function on it and optionally replacing it with another expression.

pub fn transform_and_continue_res<F>(&mut self, func: &mut F) where
    F: FnMut(&mut Expr) -> Result<(Option<Expr>, bool), WeldCompileError>, 
[src]

Recursively transforms an expression in place by running a function on it and optionally replacing it with another expression. Supports returning an error, which is treated as returning (None, false)

pub fn transform<F>(&mut self, func: &mut F) where
    F: FnMut(&mut Expr) -> Option<Expr>, 
[src]

Recursively transforms an expression in place by running a function on it and optionally replacing it with another expression.

pub fn transform_up<F>(&mut self, func: &mut F) where
    F: FnMut(&mut Expr) -> Option<Expr>, 
[src]

Recursively transforms an expression in place by running a function first on its children, then on the root expression itself; this can be more efficient than transform for some cases

pub fn transform_kind<F>(&mut self, func: &mut F) where
    F: FnMut(&mut Expr) -> Option<ExprKind>, 
[src]

Transform an expression by replacing its kind with another ExprKind.

The type of the expression is unmodified.

pub fn contains(&self, other: &Expr) -> bool[src]

Returns true if this expressions contains other.

Trait Implementations

impl HashIgnoringSymbols for Expr[src]

impl Eq for Expr[src]

impl Takeable for Expr[src]

impl Placeholder for Expr[src]

impl PartialEq<Expr> for Expr[src]

impl NewExpr for Expr[src]

impl PrettyPrint for Expr[src]

fn pretty_print(&self) -> String[src]

Pretty print an expression.

fn pretty_print_config(&self, config: &PrettyPrintConfig) -> String[src]

Pretty print an expression with the given configuration.

impl Debug for Expr[src]

impl CompareIgnoringSymbols for Expr[src]

fn compare_ignoring_symbols(
    &self,
    other: &Expr
) -> Result<bool, WeldCompileError>
[src]

Compare this expression to other.

impl InferTypes for Expr[src]

fn infer_types(&mut self) -> Result<(), WeldCompileError>[src]

Checks and infers types in place.

impl Clone for Expr[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Uniquify for Expr[src]

impl Hash for Expr[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl !Send for Expr

impl Unpin for Expr

impl !Sync for Expr

impl UnwindSafe for Expr

impl !RefUnwindSafe for Expr

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> Deserialisable<T> for T[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<K> TrieKey for K where
    K: Eq + Hash + ?Sized