Enum ValueExpr
pub enum ValueExpr {
Constant(Constant, Type),
Tuple(List<ValueExpr>, Type),
Union {
field: Int,
expr: GcCow<ValueExpr>,
union_ty: Type,
},
Variant {
discriminant: Int,
data: GcCow<ValueExpr>,
enum_ty: Type,
},
GetDiscriminant {
place: GcCow<PlaceExpr>,
},
Load {
source: GcCow<PlaceExpr>,
},
AddrOf {
target: GcCow<PlaceExpr>,
ptr_ty: PtrType,
},
UnOp {
operator: UnOp,
operand: GcCow<ValueExpr>,
},
BinOp {
operator: BinOp,
left: GcCow<ValueExpr>,
right: GcCow<ValueExpr>,
},
}Expand description
A “value expression” evaluates to a Value.
Variants§
Constant(Constant, Type)
Just return a constant value.
Tuple(List<ValueExpr>, Type)
An n-tuple, used for arrays, structs, tuples (including unit).
Union
A Union value.
Fields
Variant
A variant of an enum type.
Fields
GetDiscriminant
Read the discriminant of an enum type. As we don’t need to know the validity of the inner data we don’t fully load the variant value.
Load
Load a value from memory.
AddrOf
Create a pointer (raw pointer or reference) to a place.
Fields
UnOp
Unary operators.
BinOp
Binary operators.
Trait Implementations§
impl Copy for ValueExpr
§impl<'de> Deserialize<'de> for ValueExpr
impl<'de> Deserialize<'de> for ValueExpr
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ValueExpr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ValueExpr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ValueExpr
§impl Ord for ValueExpr
impl Ord for ValueExpr
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
§impl PartialOrd for ValueExpr
impl PartialOrd for ValueExpr
§impl Serialize for ValueExpr
impl Serialize for ValueExpr
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ValueExpr
Auto Trait Implementations§
impl !Send for ValueExpr
impl !Sync for ValueExpr
impl Freeze for ValueExpr
impl RefUnwindSafe for ValueExpr
impl Unpin for ValueExpr
impl UnsafeUnpin for ValueExpr
impl UnwindSafe for ValueExpr
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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