pub enum Expr<'db> {
Show 23 variants
Tuple(ExprTuple<'db>),
Snapshot(ExprSnapshot<'db>),
Desnap(ExprDesnap<'db>),
Assignment(ExprAssignment<'db>),
LogicalOperator(ExprLogicalOperator<'db>),
Block(ExprBlock<'db>),
Loop(ExprLoop<'db>),
While(ExprWhile<'db>),
For(ExprFor<'db>),
FunctionCall(ExprFunctionCall<'db>),
Match(ExprMatch<'db>),
If(ExprIf<'db>),
Var(ExprVar<'db>),
Literal(ExprLiteral<'db>),
StringLiteral(ExprStringLiteral<'db>),
MemberAccess(ExprMemberAccess<'db>),
StructCtor(ExprStructCtor<'db>),
EnumVariantCtor(ExprEnumVariantCtor<'db>),
PropagateError(ExprPropagateError<'db>),
Constant(ExprConstant<'db>),
FixedSizeArray(ExprFixedSizeArray<'db>),
ExprClosure(ExprClosure<'db>),
Missing(ExprMissing<'db>),
}Variants§
Tuple(ExprTuple<'db>)
Snapshot(ExprSnapshot<'db>)
Desnap(ExprDesnap<'db>)
Assignment(ExprAssignment<'db>)
LogicalOperator(ExprLogicalOperator<'db>)
Block(ExprBlock<'db>)
Loop(ExprLoop<'db>)
While(ExprWhile<'db>)
For(ExprFor<'db>)
FunctionCall(ExprFunctionCall<'db>)
Match(ExprMatch<'db>)
If(ExprIf<'db>)
Var(ExprVar<'db>)
Literal(ExprLiteral<'db>)
StringLiteral(ExprStringLiteral<'db>)
MemberAccess(ExprMemberAccess<'db>)
StructCtor(ExprStructCtor<'db>)
EnumVariantCtor(ExprEnumVariantCtor<'db>)
PropagateError(ExprPropagateError<'db>)
Constant(ExprConstant<'db>)
FixedSizeArray(ExprFixedSizeArray<'db>)
ExprClosure(ExprClosure<'db>)
Missing(ExprMissing<'db>)
Implementations§
Source§impl<'db> Expr<'db>
impl<'db> Expr<'db>
pub fn ty(&self) -> TypeId<'db>
pub fn stable_ptr(&self) -> ExprPtr<'db>
Sourcepub fn as_member_path(&self) -> Option<ExprVarMemberPath<'db>>
pub fn as_member_path(&self) -> Option<ExprVarMemberPath<'db>>
Returns the member path of the expression, if it is a variable or a member access.
Sourcepub fn is_mutable_var(
&self,
semantic_defs: &UnorderedHashMap<VarId<'db>, Binding<'db>>,
) -> bool
pub fn is_mutable_var( &self, semantic_defs: &UnorderedHashMap<VarId<'db>, Binding<'db>>, ) -> bool
Returns true if the expression is a variable or a member access of a mutable variable.
Trait Implementations§
Source§impl<'db> DebugWithDb<'db> for Expr<'db>
impl<'db> DebugWithDb<'db> for Expr<'db>
type Db = ExprFormatter<'db>
fn fmt(&self, f: &mut Formatter<'_>, db: &'db ExprFormatter<'db>) -> Result
fn debug<'me>(&'me self, db: &'db Self::Db) -> DebugWith<'me, 'db, Self::Db>where
Self: Sized + 'me,
fn into_debug<'me>(self, db: &'db Self::Db) -> DebugWith<'me, 'db, Self::Db>where
Self: Sized + 'me,
Source§impl<'db> From<&Expr<'db>> for SyntaxStablePtrId<'db>
impl<'db> From<&Expr<'db>> for SyntaxStablePtrId<'db>
Source§impl<'db, T: SemanticRewriter<ExprTuple<'db>, Error> + SemanticRewriter<ExprSnapshot<'db>, Error> + SemanticRewriter<ExprDesnap<'db>, Error> + SemanticRewriter<ExprAssignment<'db>, Error> + SemanticRewriter<ExprLogicalOperator<'db>, Error> + SemanticRewriter<ExprBlock<'db>, Error> + SemanticRewriter<ExprLoop<'db>, Error> + SemanticRewriter<ExprWhile<'db>, Error> + SemanticRewriter<ExprFor<'db>, Error> + SemanticRewriter<ExprFunctionCall<'db>, Error> + SemanticRewriter<ExprMatch<'db>, Error> + SemanticRewriter<ExprIf<'db>, Error> + SemanticRewriter<ExprVar<'db>, Error> + SemanticRewriter<ExprLiteral<'db>, Error> + SemanticRewriter<ExprStringLiteral<'db>, Error> + SemanticRewriter<ExprMemberAccess<'db>, Error> + SemanticRewriter<ExprStructCtor<'db>, Error> + SemanticRewriter<ExprEnumVariantCtor<'db>, Error> + SemanticRewriter<ExprPropagateError<'db>, Error> + SemanticRewriter<ExprConstant<'db>, Error> + SemanticRewriter<ExprFixedSizeArray<'db>, Error> + SemanticRewriter<ExprClosure<'db>, Error> + SemanticRewriter<ExprMissing<'db>, Error>, Error> SemanticObject<T, Error> for Expr<'db>
impl<'db, T: SemanticRewriter<ExprTuple<'db>, Error> + SemanticRewriter<ExprSnapshot<'db>, Error> + SemanticRewriter<ExprDesnap<'db>, Error> + SemanticRewriter<ExprAssignment<'db>, Error> + SemanticRewriter<ExprLogicalOperator<'db>, Error> + SemanticRewriter<ExprBlock<'db>, Error> + SemanticRewriter<ExprLoop<'db>, Error> + SemanticRewriter<ExprWhile<'db>, Error> + SemanticRewriter<ExprFor<'db>, Error> + SemanticRewriter<ExprFunctionCall<'db>, Error> + SemanticRewriter<ExprMatch<'db>, Error> + SemanticRewriter<ExprIf<'db>, Error> + SemanticRewriter<ExprVar<'db>, Error> + SemanticRewriter<ExprLiteral<'db>, Error> + SemanticRewriter<ExprStringLiteral<'db>, Error> + SemanticRewriter<ExprMemberAccess<'db>, Error> + SemanticRewriter<ExprStructCtor<'db>, Error> + SemanticRewriter<ExprEnumVariantCtor<'db>, Error> + SemanticRewriter<ExprPropagateError<'db>, Error> + SemanticRewriter<ExprConstant<'db>, Error> + SemanticRewriter<ExprFixedSizeArray<'db>, Error> + SemanticRewriter<ExprClosure<'db>, Error> + SemanticRewriter<ExprMissing<'db>, Error>, Error> SemanticObject<T, Error> for Expr<'db>
fn default_rewrite(&mut self, rewriter: &mut T) -> Result<RewriteResult, Error>
impl<'db> Eq for Expr<'db>
impl<'db> StructuralPartialEq for Expr<'db>
Auto Trait Implementations§
impl<'db> Freeze for Expr<'db>
impl<'db> RefUnwindSafe for Expr<'db>
impl<'db> Send for Expr<'db>
impl<'db> Sync for Expr<'db>
impl<'db> Unpin for Expr<'db>
impl<'db> UnwindSafe for Expr<'db>
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<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
fn debug_db_upcast(&'db self) -> &'db T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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