pub struct Expr {
pub matching_source: Fragment,
pub kind: ExprKind,
}Available on crate feature
ast-models only.Expand description
An expression in wright source code.
Fields§
§matching_source: FragmentThe source code of the whole expression.
kind: ExprKindWhat kind of expression this is.
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn is_error(&self) -> bool
pub fn is_error(&self) -> bool
Is this an ExprKind::Error?
Sourcepub fn is_block_like(&self) -> bool
pub fn is_block_like(&self) -> bool
Is this a “block-like” expression – one that ends with a block ({ ... }) and so does not need a
semicolon after it when used as a statement?
Trait Implementations§
Source§impl AstNode for Expr
impl AstNode for Expr
Source§fn matching_source(&self) -> &Fragment
fn matching_source(&self) -> &Fragment
Get the Fragment of source code this node was parsed from.
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Forget for Expr
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more