Skip to main content

ExprKind

Enum ExprKind 

Source
pub enum ExprKind {
Show 47 variants NoOp, Constant(Value), Module { name: ArcStr, value: ModuleKind, }, ExplicitParens(Arc<Expr>), Do { exprs: Arc<[Expr]>, }, Use { name: ModPath, }, Bind(Arc<BindExpr>), Ref { name: ModPath, }, Connect { name: ModPath, value: Arc<Expr>, deref: bool, }, StringInterpolate { args: Arc<[Expr]>, }, StructRef { source: Arc<Expr>, field: ArcStr, }, TupleRef { source: Arc<Expr>, field: usize, }, ArrayRef { source: Arc<Expr>, i: Arc<Expr>, }, ArraySlice { source: Arc<Expr>, start: Option<Arc<Expr>>, end: Option<Arc<Expr>>, }, MapRef { source: Arc<Expr>, key: Arc<Expr>, }, StructWith(StructWithExpr), Lambda(Arc<LambdaExpr>), TypeDef(TypeDefExpr), TypeCast { expr: Arc<Expr>, typ: Type, }, Apply(ApplyExpr), Any { args: Arc<[Expr]>, }, Array { args: Arc<[Expr]>, }, Map { args: Arc<[(Expr, Expr)]>, }, Tuple { args: Arc<[Expr]>, }, Variant { tag: ArcStr, args: Arc<[Expr]>, }, Struct(StructExpr), Select(SelectExpr), Qop(Arc<Expr>), OrNever(Arc<Expr>), TryCatch(Arc<TryCatchExpr>), ByRef(Arc<Expr>), Deref(Arc<Expr>), Eq { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Ne { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Lt { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Gt { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Lte { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Gte { lhs: Arc<Expr>, rhs: Arc<Expr>, }, And { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Or { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Not { expr: Arc<Expr>, }, Add { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Sub { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Mul { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Div { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Mod { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Sample { lhs: Arc<Expr>, rhs: Arc<Expr>, },
}

Variants§

§

NoOp

§

Constant(Value)

§

Module

Fields

§name: ArcStr
§

ExplicitParens(Arc<Expr>)

§

Do

Fields

§exprs: Arc<[Expr]>
§

Use

Fields

§name: ModPath
§

Bind(Arc<BindExpr>)

§

Ref

Fields

§name: ModPath
§

Connect

Fields

§name: ModPath
§value: Arc<Expr>
§deref: bool
§

StringInterpolate

Fields

§args: Arc<[Expr]>
§

StructRef

Fields

§source: Arc<Expr>
§field: ArcStr
§

TupleRef

Fields

§source: Arc<Expr>
§field: usize
§

ArrayRef

Fields

§source: Arc<Expr>
§

ArraySlice

Fields

§source: Arc<Expr>
§start: Option<Arc<Expr>>
§

MapRef

Fields

§source: Arc<Expr>
§key: Arc<Expr>
§

StructWith(StructWithExpr)

§

Lambda(Arc<LambdaExpr>)

§

TypeDef(TypeDefExpr)

§

TypeCast

Fields

§expr: Arc<Expr>
§typ: Type
§

Apply(ApplyExpr)

§

Any

Fields

§args: Arc<[Expr]>
§

Array

Fields

§args: Arc<[Expr]>
§

Map

Fields

§args: Arc<[(Expr, Expr)]>
§

Tuple

Fields

§args: Arc<[Expr]>
§

Variant

Fields

§args: Arc<[Expr]>
§

Struct(StructExpr)

§

Select(SelectExpr)

§

Qop(Arc<Expr>)

§

OrNever(Arc<Expr>)

§

TryCatch(Arc<TryCatchExpr>)

§

ByRef(Arc<Expr>)

§

Deref(Arc<Expr>)

§

Eq

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Ne

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Lt

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Gt

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Lte

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Gte

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

And

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Or

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Not

Fields

§expr: Arc<Expr>
§

Add

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Sub

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Mul

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Div

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Mod

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Sample

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>

Implementations§

Source§

impl ExprKind

Source

pub fn to_expr(self, pos: SourcePosition) -> Expr

Source

pub fn to_expr_nopos(self) -> Expr

does not provide any position information or comment

Trait Implementations§

Source§

impl Clone for ExprKind

Source§

fn clone(&self) -> ExprKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExprKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ExprKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ExprKind

Source§

fn eq(&self, other: &ExprKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for ExprKind

Source§

fn partial_cmp(&self, other: &ExprKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PrettyDisplay for ExprKind

Source§

fn fmt_pretty_inner(&self, buf: &mut PrettyBuf) -> Result

Do the actual pretty print. This should not be called directly, it will be called by fmt_pretty when we know it can’t fit on a single line.
Source§

fn fmt_pretty(&self, buf: &mut PrettyBuf) -> Result

This is the user facing fmt method, it will first try to format the expression on a single line, and if that is impossible it will call the pretty printer.
Source§

fn to_string_pretty(&self, limit: usize) -> LPooled<String>

Pretty print to a pooled string
Source§

impl StructuralPartialEq for ExprKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V