Enum ExpressionKind

Source
pub enum ExpressionKind<'hir> {
Show 15 variants Array(&'hir [Expression<'hir>]), Unary { op: UnaryOp, expr: &'hir Expression<'hir>, }, Ref(&'hir Expression<'hir>), Deref(&'hir Expression<'hir>), Logical { left: &'hir Expression<'hir>, op: LogicalOp, right: &'hir Expression<'hir>, }, Comparison { left: &'hir Expression<'hir>, op: CmpOp, right: &'hir Expression<'hir>, }, Arithmetic { left: &'hir Expression<'hir>, op: ArithmeticOp, right: &'hir Expression<'hir>, }, Ternary { cond: &'hir Expression<'hir>, if_true: &'hir Expression<'hir>, if_false: &'hir Expression<'hir>, }, Assignment { left: &'hir Expression<'hir>, right: &'hir Expression<'hir>, }, Variable(Path), Literal(LitValue), Call { callee: &'hir Expression<'hir>, args: &'hir [Expression<'hir>], }, Cast { expr: &'hir Expression<'hir>, to: &'hir Type<'hir>, }, ArrayAccess { arr: &'hir Expression<'hir>, index: &'hir Expression<'hir>, }, StructAccess { st: &'hir Expression<'hir>, field: Ident, },
}

Variants§

§

Array(&'hir [Expression<'hir>])

§

Unary

Fields

§expr: &'hir Expression<'hir>
§

Ref(&'hir Expression<'hir>)

§

Deref(&'hir Expression<'hir>)

§

Logical

Fields

§left: &'hir Expression<'hir>
§right: &'hir Expression<'hir>
§

Comparison

Fields

§left: &'hir Expression<'hir>
§right: &'hir Expression<'hir>
§

Arithmetic

Fields

§left: &'hir Expression<'hir>
§right: &'hir Expression<'hir>
§

Ternary

Fields

§cond: &'hir Expression<'hir>
§if_true: &'hir Expression<'hir>
§if_false: &'hir Expression<'hir>
§

Assignment

Fields

§left: &'hir Expression<'hir>
§right: &'hir Expression<'hir>
§

Variable(Path)

§

Literal(LitValue)

§

Call

Fields

§callee: &'hir Expression<'hir>
§args: &'hir [Expression<'hir>]
§

Cast

Fields

§expr: &'hir Expression<'hir>
§to: &'hir Type<'hir>
§

ArrayAccess

Fields

§arr: &'hir Expression<'hir>
§index: &'hir Expression<'hir>
§

StructAccess

Fields

§st: &'hir Expression<'hir>
§field: Ident

Trait Implementations§

Source§

impl<'hir> Debug for ExpressionKind<'hir>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'hir> Freeze for ExpressionKind<'hir>

§

impl<'hir> !RefUnwindSafe for ExpressionKind<'hir>

§

impl<'hir> !Send for ExpressionKind<'hir>

§

impl<'hir> !Sync for ExpressionKind<'hir>

§

impl<'hir> Unpin for ExpressionKind<'hir>

§

impl<'hir> !UnwindSafe for ExpressionKind<'hir>

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<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> 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, 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.