pub enum SymExprKind<'db> {
Show 15 variants
Semi(SymExpr<'db>, SymExpr<'db>),
Tuple(Vec<SymExpr<'db>>),
Primitive(SymLiteral),
ByteLiteral(SymByteLiteral<'db>),
LetIn {
lv: SymVariable<'db>,
ty: SymTy<'db>,
initializer: Option<SymExpr<'db>>,
body: SymExpr<'db>,
},
Await {
future: SymExpr<'db>,
await_keyword: Span<'db>,
},
Assign {
place: SymPlaceExpr<'db>,
value: SymExpr<'db>,
},
PermissionOp(PermissionOp, SymPlaceExpr<'db>),
Call {
function: SymFunction<'db>,
substitution: Vec<SymGenericTerm<'db>>,
arg_temps: Vec<SymVariable<'db>>,
},
Return(SymExpr<'db>),
Not {
operand: SymExpr<'db>,
op_span: Span<'db>,
},
BinaryOp(SymBinaryOp, SymExpr<'db>, SymExpr<'db>),
Aggregate {
ty: SymTy<'db>,
fields: Vec<SymExpr<'db>>,
},
Match {
arms: Vec<SymMatchArm<'db>>,
},
Error(Reported),
}Variants§
Semi(SymExpr<'db>, SymExpr<'db>)
$expr1; $expr2
Tuple(Vec<SymExpr<'db>>)
(...)
Primitive(SymLiteral)
22 etc
ByteLiteral(SymByteLiteral<'db>)
b"..."
LetIn
let $lv: $ty [= $initializer] in $body
Await
future.await
Assign
$place = $expr
PermissionOp(PermissionOp, SymPlaceExpr<'db>)
$0.lease etc
Call
$0[$1..]($2..)
During construction we ensure that the arities match and terms are well-kinded (or generate errors).
Fields
§
function: SymFunction<'db>§
substitution: Vec<SymGenericTerm<'db>>§
arg_temps: Vec<SymVariable<'db>>Return(SymExpr<'db>)
Return a value from this function
Not
Boolean not
BinaryOp(SymBinaryOp, SymExpr<'db>, SymExpr<'db>)
a + b etc
Aggregate
Something like Point { x: ..., y: ... }
Match
Match, if/else-if chain, etc
Fields
§
arms: Vec<SymMatchArm<'db>>Error(Reported)
Error occurred somewhere.
Trait Implementations§
Source§impl<'db> Clone for SymExprKind<'db>
impl<'db> Clone for SymExprKind<'db>
Source§fn clone(&self) -> SymExprKind<'db>
fn clone(&self) -> SymExprKind<'db>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'db> Debug for SymExprKind<'db>
impl<'db> Debug for SymExprKind<'db>
Source§impl<'db> Hash for SymExprKind<'db>
impl<'db> Hash for SymExprKind<'db>
Source§impl<'db> Ord for SymExprKind<'db>
impl<'db> Ord for SymExprKind<'db>
Source§fn cmp(&self, other: &SymExprKind<'db>) -> Ordering
fn cmp(&self, other: &SymExprKind<'db>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'db> PartialEq for SymExprKind<'db>
impl<'db> PartialEq for SymExprKind<'db>
Source§impl<'db> PartialOrd for SymExprKind<'db>
impl<'db> PartialOrd for SymExprKind<'db>
Source§impl<'db> Serialize for SymExprKind<'db>
impl<'db> Serialize for SymExprKind<'db>
Source§impl<'db> Subst<'db> for SymExprKind<'db>
impl<'db> Subst<'db> for SymExprKind<'db>
Source§type GenericTerm = SymGenericTerm<'db>
type GenericTerm = SymGenericTerm<'db>
The notion of generic term appropriate for this type.
When we substitute variables, this is the type of value that we replace them with.
Source§fn subst_vars(
&self,
db: &'db dyn Db,
map: &Map<SymVariable<'db>, Self::GenericTerm>,
) -> Self::Output
fn subst_vars( &self, db: &'db dyn Db, map: &Map<SymVariable<'db>, Self::GenericTerm>, ) -> Self::Output
Returns a version of
self where universal free variables
have been replaced by the corresponding entry in terms.
If a variable is not present in terms it is not substituted.Source§fn subst_var(
&self,
db: &'db dyn Db,
var: SymVariable<'db>,
term: Self::GenericTerm,
) -> Self::Output
fn subst_var( &self, db: &'db dyn Db, var: SymVariable<'db>, term: Self::GenericTerm, ) -> Self::Output
Replace the variable
var with term.Source§fn resolve_infer_var(
&self,
db: &'db dyn Db,
bound_vars: &mut Vec<SymVariable<'db>>,
op: impl FnMut(InferVarIndex) -> Option<Self::GenericTerm>,
) -> Self::Output
fn resolve_infer_var( &self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, op: impl FnMut(InferVarIndex) -> Option<Self::GenericTerm>, ) -> Self::Output
Replace all inference variables with whatever is returned by
op;
if op returns None, the inference variable is left unchanged.Source§impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymExprKind<'db>
impl<'db> SubstWith<'db, SymGenericTerm<'db>> for SymExprKind<'db>
Source§type Output = SymExprKind<'db>
type Output = SymExprKind<'db>
The type of the resulting term; typically
Self but not always.Source§fn subst_with<'subst>(
&'subst self,
db: &'db dyn Db,
bound_vars: &mut Vec<SymVariable<'db>>,
subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>,
) -> Self::Output
fn subst_with<'subst>( &'subst self, db: &'db dyn Db, bound_vars: &mut Vec<SymVariable<'db>>, subst_fns: &mut SubstitutionFns<'_, 'db, SymGenericTerm<'db>>, ) -> Self::Output
Source§impl<'db> Update for SymExprKind<'db>
impl<'db> Update for SymExprKind<'db>
impl<'db> Eq for SymExprKind<'db>
impl<'db> StructuralPartialEq for SymExprKind<'db>
Auto Trait Implementations§
impl<'db> Freeze for SymExprKind<'db>
impl<'db> !RefUnwindSafe for SymExprKind<'db>
impl<'db> Send for SymExprKind<'db>
impl<'db> Sync for SymExprKind<'db>
impl<'db> Unpin for SymExprKind<'db>
impl<'db> UnsafeUnpin for SymExprKind<'db>
impl<'db> !UnwindSafe for SymExprKind<'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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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