Enum BinOp
pub enum BinOp {
Int(IntBinOp),
IntWithOverflow(IntBinOpWithOverflow),
Rel(RelOp),
PtrOffset {
inbounds: bool,
},
PtrOffsetFrom {
inbounds: bool,
nonneg: bool,
},
ConstructWidePointer(PtrType),
}Variants§
Int(IntBinOp)
An operation on integers (both must have the same type); returns an integer of the same type.
IntWithOverflow(IntBinOpWithOverflow)
An operation on integers (both must have the same type); returns a tuple of integer of the same type and a boolean that is true if the result is not equal to the infinite-precision result.
Rel(RelOp)
Compares two values according to the given relational operator. Both must have the same type, and they must both be integers, Booleans, or pointers.
PtrOffset
Add a byte-offset to a pointer (with or without inbounds requirement). Takes a pointer as left operand and an integer as right operand; returns a pointer. FIXME: should we make this in units of the pointee size? The thing is, for raw pointers we do not have the pointee type…
PtrOffsetFrom
Compute the distance between two pointers in bytes (with or without inbounds requirement).
Takes two pointers; returns a signed pointer-sized integer.
If nonneg is true, it is UB for the result to be negative.
ConstructWidePointer(PtrType)
This corresponds to core::ptr::from_raw_parts
and takes a thin pointer and matching metadata to construct a pointer of the given type.
When the target type is a thin pointer and the metadata is (), this is just a pointer cast.
Trait Implementations§
impl Copy for BinOp
§impl<'de> Deserialize<'de> for BinOp
impl<'de> Deserialize<'de> for BinOp
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BinOp, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BinOp, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for BinOp
§impl Ord for BinOp
impl Ord for BinOp
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialOrd for BinOp
impl PartialOrd for BinOp
§impl Serialize for BinOp
impl Serialize for BinOp
§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,
impl StructuralPartialEq for BinOp
Auto Trait Implementations§
impl !Send for BinOp
impl !Sync for BinOp
impl Freeze for BinOp
impl RefUnwindSafe for BinOp
impl Unpin for BinOp
impl UnsafeUnpin for BinOp
impl UnwindSafe for BinOp
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
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
§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
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> ⓘ
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> ⓘ
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