pub enum ConstantExprKind {
Show 28 variants
Bool(bool),
Integer(IntegerValue),
Char(char),
Float(FloatValue),
Adt(Option<VariantId>, IndexVec<FieldId, ConstantExpr>),
Array(Vec<ConstantExpr>),
Ref(GlobalPlace, Option<UnsizingMetadata>),
Ptr(RefKind, GlobalPlace, Option<UnsizingMetadata>),
Str(String),
ByteStr(Vec<u8>),
FnDef(FnPtr),
FnPtr(FnPtr),
Cast(ConstantExpr, CastKind),
PtrNoProvenance(u128),
ExternSymbol(String),
TypeId(Ty),
RawMemory(Vec<Byte>),
Var(ConstGenericDbVar),
Global(GlobalDeclRef),
Call(FnPtr, Vec<ConstantExpr>),
TraitConst(TraitRef, AssocConstId),
VTableRef(PolyTraitRef),
Discriminant(TypeDeclRef, VariantId),
Repeat {
value: ConstantExpr,
count: ConstantExpr,
value_is_sized: Option<TraitRef>,
},
SizeOf(Ty),
AlignOf(Ty),
OffsetOf(TypeDeclRef, Option<VariantId>, FieldId),
Opaque(String),
}Variants§
Bool(bool)
Boolean value.
Integer(IntegerValue)
Integer value.
Char(char)
Char value.
Float(FloatValue)
Float value.
Adt(Option<VariantId>, IndexVec<FieldId, ConstantExpr>)
Value of an ADT (struct or enum).
This is eliminated inside functions if --raw-consts is off.
Array(Vec<ConstantExpr>)
Array value.
This is eliminated inside functions if --raw-consts is off.
Ref(GlobalPlace, Option<UnsizingMetadata>)
A shared reference to a constant place.
This is eliminated inside functions if --raw-consts is off.
Ptr(RefKind, GlobalPlace, Option<UnsizingMetadata>)
A raw pointer to a constant place.
This is eliminated inside functions if --raw-consts is off.
Str(String)
str value. This represents an unsized value of type str (and not &str).
ByteStr(Vec<u8>)
Byte string value.
FnDef(FnPtr)
ZST constant corresponding to the unique value of the type of a function item.
FnPtr(FnPtr)
A function pointer value; this is a pointer (i.e. an address).
This is eliminated inside functions if --raw-consts is off.
Cast(ConstantExpr, CastKind)
Cast a constant value to another type (e.g. erase a vtable method pointer to *const ()).
PtrNoProvenance(u128)
A pointer with no provenance (e.g. 0 for the null pointer)
This is eliminated inside functions if --raw-consts is off.
ExternSymbol(String)
The address of a linker symbol, as a *const (). The address may be null, if the
symbol wasn’t defined at link time.
TypeId(Ty)
The TypeId value for a type.
RawMemory(Vec<Byte>)
Raw memory value obtained from constant evaluation. Used when a more structured representation isn’t possible (e.g. for unions) or just isn’t implemented yet.
Var(ConstGenericDbVar)
A const generic var
Global(GlobalDeclRef)
The value of a constant/static.
This is eliminated inside functions if --raw-consts is off.
Call(FnPtr, Vec<ConstantExpr>)
A call to a const fn.
TraitConst(TraitRef, AssocConstId)
A trait associated constant.
E.g.:
impl Foo for Bar {
const C : usize = 32; // <-
}VTableRef(PolyTraitRef)
A reference to the vtable static item for this trait ref. This can be normalized if we
emitted a vtable item.
This is eliminated if --raw-consts is off.
Discriminant(TypeDeclRef, VariantId)
The integer discriminant value corresponding to this enum variant.
Repeat
Make an array of count copies of value. value does not need to be Copy or Clone.
SizeOf(Ty)
The size of the given type.
AlignOf(Ty)
The alignment of the given type.
OffsetOf(TypeDeclRef, Option<VariantId>, FieldId)
The offset of the given field.
Opaque(String)
A constant expression that Charon doesn’t handle, along with the reason why.
Implementations§
Source§impl ConstantExprKind
impl ConstantExprKind
Sourcepub fn is_bool(&self) -> bool
pub fn is_bool(&self) -> bool
Returns true if this is a ConstantExprKind::Bool, otherwise false
Sourcepub fn as_bool_mut(&mut self) -> Option<&mut bool>
pub fn as_bool_mut(&mut self) -> Option<&mut bool>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Bool, otherwise None
Sourcepub fn as_bool(&self) -> Option<&bool>
pub fn as_bool(&self) -> Option<&bool>
Optionally returns references to the inner fields if this is a ConstantExprKind::Bool, otherwise None
Sourcepub fn into_bool(self) -> Result<bool, Self>
pub fn into_bool(self) -> Result<bool, Self>
Returns the inner fields if this is a ConstantExprKind::Bool, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_bool_unchecked(self) -> bool
pub unsafe fn into_bool_unchecked(self) -> bool
Unchecked return of the inner fields of ConstantExprKind::Bool.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_bool_unchecked(&self) -> &bool
pub unsafe fn as_bool_unchecked(&self) -> &bool
Unchecked reference of the inner fields of ConstantExprKind::Bool.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_bool_mut_unchecked(&mut self) -> &mut bool
pub unsafe fn as_bool_mut_unchecked(&mut self) -> &mut bool
Unchecked mutable reference of the inner fields of ConstantExprKind::Bool.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns true if this is a ConstantExprKind::Integer, otherwise false
Sourcepub fn as_integer_mut(&mut self) -> Option<&mut IntegerValue>
pub fn as_integer_mut(&mut self) -> Option<&mut IntegerValue>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Integer, otherwise None
Sourcepub fn as_integer(&self) -> Option<&IntegerValue>
pub fn as_integer(&self) -> Option<&IntegerValue>
Optionally returns references to the inner fields if this is a ConstantExprKind::Integer, otherwise None
Sourcepub fn into_integer(self) -> Result<IntegerValue, Self>
pub fn into_integer(self) -> Result<IntegerValue, Self>
Returns the inner fields if this is a ConstantExprKind::Integer, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_integer_unchecked(self) -> IntegerValue
pub unsafe fn into_integer_unchecked(self) -> IntegerValue
Unchecked return of the inner fields of ConstantExprKind::Integer.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_integer_unchecked(&self) -> &IntegerValue
pub unsafe fn as_integer_unchecked(&self) -> &IntegerValue
Unchecked reference of the inner fields of ConstantExprKind::Integer.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_integer_mut_unchecked(&mut self) -> &mut IntegerValue
pub unsafe fn as_integer_mut_unchecked(&mut self) -> &mut IntegerValue
Unchecked mutable reference of the inner fields of ConstantExprKind::Integer.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_char(&self) -> bool
pub fn is_char(&self) -> bool
Returns true if this is a ConstantExprKind::Char, otherwise false
Sourcepub fn as_char_mut(&mut self) -> Option<&mut char>
pub fn as_char_mut(&mut self) -> Option<&mut char>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Char, otherwise None
Sourcepub fn as_char(&self) -> Option<&char>
pub fn as_char(&self) -> Option<&char>
Optionally returns references to the inner fields if this is a ConstantExprKind::Char, otherwise None
Sourcepub fn into_char(self) -> Result<char, Self>
pub fn into_char(self) -> Result<char, Self>
Returns the inner fields if this is a ConstantExprKind::Char, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_char_unchecked(self) -> char
pub unsafe fn into_char_unchecked(self) -> char
Unchecked return of the inner fields of ConstantExprKind::Char.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_char_unchecked(&self) -> &char
pub unsafe fn as_char_unchecked(&self) -> &char
Unchecked reference of the inner fields of ConstantExprKind::Char.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_char_mut_unchecked(&mut self) -> &mut char
pub unsafe fn as_char_mut_unchecked(&mut self) -> &mut char
Unchecked mutable reference of the inner fields of ConstantExprKind::Char.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_float(&self) -> bool
pub fn is_float(&self) -> bool
Returns true if this is a ConstantExprKind::Float, otherwise false
Sourcepub fn as_float_mut(&mut self) -> Option<&mut FloatValue>
pub fn as_float_mut(&mut self) -> Option<&mut FloatValue>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Float, otherwise None
Sourcepub fn as_float(&self) -> Option<&FloatValue>
pub fn as_float(&self) -> Option<&FloatValue>
Optionally returns references to the inner fields if this is a ConstantExprKind::Float, otherwise None
Sourcepub fn into_float(self) -> Result<FloatValue, Self>
pub fn into_float(self) -> Result<FloatValue, Self>
Returns the inner fields if this is a ConstantExprKind::Float, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_float_unchecked(self) -> FloatValue
pub unsafe fn into_float_unchecked(self) -> FloatValue
Unchecked return of the inner fields of ConstantExprKind::Float.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_float_unchecked(&self) -> &FloatValue
pub unsafe fn as_float_unchecked(&self) -> &FloatValue
Unchecked reference of the inner fields of ConstantExprKind::Float.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_float_mut_unchecked(&mut self) -> &mut FloatValue
pub unsafe fn as_float_mut_unchecked(&mut self) -> &mut FloatValue
Unchecked mutable reference of the inner fields of ConstantExprKind::Float.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_adt_mut(
&mut self,
) -> Option<(&mut Option<VariantId>, &mut IndexVec<FieldId, ConstantExpr>)>
pub fn as_adt_mut( &mut self, ) -> Option<(&mut Option<VariantId>, &mut IndexVec<FieldId, ConstantExpr>)>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Adt, otherwise None
Sourcepub fn as_adt(
&self,
) -> Option<(&Option<VariantId>, &IndexVec<FieldId, ConstantExpr>)>
pub fn as_adt( &self, ) -> Option<(&Option<VariantId>, &IndexVec<FieldId, ConstantExpr>)>
Optionally returns references to the inner fields if this is a ConstantExprKind::Adt, otherwise None
Sourcepub fn into_adt(
self,
) -> Result<(Option<VariantId>, IndexVec<FieldId, ConstantExpr>), Self>
pub fn into_adt( self, ) -> Result<(Option<VariantId>, IndexVec<FieldId, ConstantExpr>), Self>
Returns the inner fields if this is a ConstantExprKind::Adt, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_adt_unchecked(
self,
) -> (Option<VariantId>, IndexVec<FieldId, ConstantExpr>)
pub unsafe fn into_adt_unchecked( self, ) -> (Option<VariantId>, IndexVec<FieldId, ConstantExpr>)
Unchecked return of the inner fields of ConstantExprKind::Adt.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_adt_unchecked(
&self,
) -> (&Option<VariantId>, &IndexVec<FieldId, ConstantExpr>)
pub unsafe fn as_adt_unchecked( &self, ) -> (&Option<VariantId>, &IndexVec<FieldId, ConstantExpr>)
Unchecked reference of the inner fields of ConstantExprKind::Adt.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_adt_mut_unchecked(
&mut self,
) -> (&mut Option<VariantId>, &mut IndexVec<FieldId, ConstantExpr>)
pub unsafe fn as_adt_mut_unchecked( &mut self, ) -> (&mut Option<VariantId>, &mut IndexVec<FieldId, ConstantExpr>)
Unchecked mutable reference of the inner fields of ConstantExprKind::Adt.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_array(&self) -> bool
pub fn is_array(&self) -> bool
Returns true if this is a ConstantExprKind::Array, otherwise false
Sourcepub fn as_array_mut(&mut self) -> Option<&mut Vec<ConstantExpr>>
pub fn as_array_mut(&mut self) -> Option<&mut Vec<ConstantExpr>>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Array, otherwise None
Sourcepub fn as_array(&self) -> Option<&Vec<ConstantExpr>>
pub fn as_array(&self) -> Option<&Vec<ConstantExpr>>
Optionally returns references to the inner fields if this is a ConstantExprKind::Array, otherwise None
Sourcepub fn into_array(self) -> Result<Vec<ConstantExpr>, Self>
pub fn into_array(self) -> Result<Vec<ConstantExpr>, Self>
Returns the inner fields if this is a ConstantExprKind::Array, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_array_unchecked(self) -> Vec<ConstantExpr>
pub unsafe fn into_array_unchecked(self) -> Vec<ConstantExpr>
Unchecked return of the inner fields of ConstantExprKind::Array.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_array_unchecked(&self) -> &Vec<ConstantExpr>
pub unsafe fn as_array_unchecked(&self) -> &Vec<ConstantExpr>
Unchecked reference of the inner fields of ConstantExprKind::Array.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_array_mut_unchecked(&mut self) -> &mut Vec<ConstantExpr>
pub unsafe fn as_array_mut_unchecked(&mut self) -> &mut Vec<ConstantExpr>
Unchecked mutable reference of the inner fields of ConstantExprKind::Array.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_ref_mut(
&mut self,
) -> Option<(&mut GlobalPlace, &mut Option<UnsizingMetadata>)>
pub fn as_ref_mut( &mut self, ) -> Option<(&mut GlobalPlace, &mut Option<UnsizingMetadata>)>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Ref, otherwise None
Sourcepub fn as_ref(&self) -> Option<(&GlobalPlace, &Option<UnsizingMetadata>)>
pub fn as_ref(&self) -> Option<(&GlobalPlace, &Option<UnsizingMetadata>)>
Optionally returns references to the inner fields if this is a ConstantExprKind::Ref, otherwise None
Sourcepub fn into_ref(self) -> Result<(GlobalPlace, Option<UnsizingMetadata>), Self>
pub fn into_ref(self) -> Result<(GlobalPlace, Option<UnsizingMetadata>), Self>
Returns the inner fields if this is a ConstantExprKind::Ref, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_ref_unchecked(
self,
) -> (GlobalPlace, Option<UnsizingMetadata>)
pub unsafe fn into_ref_unchecked( self, ) -> (GlobalPlace, Option<UnsizingMetadata>)
Unchecked return of the inner fields of ConstantExprKind::Ref.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_ref_unchecked(
&self,
) -> (&GlobalPlace, &Option<UnsizingMetadata>)
pub unsafe fn as_ref_unchecked( &self, ) -> (&GlobalPlace, &Option<UnsizingMetadata>)
Unchecked reference of the inner fields of ConstantExprKind::Ref.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_ref_mut_unchecked(
&mut self,
) -> (&mut GlobalPlace, &mut Option<UnsizingMetadata>)
pub unsafe fn as_ref_mut_unchecked( &mut self, ) -> (&mut GlobalPlace, &mut Option<UnsizingMetadata>)
Unchecked mutable reference of the inner fields of ConstantExprKind::Ref.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_ptr_mut(
&mut self,
) -> Option<(&mut RefKind, &mut GlobalPlace, &mut Option<UnsizingMetadata>)>
pub fn as_ptr_mut( &mut self, ) -> Option<(&mut RefKind, &mut GlobalPlace, &mut Option<UnsizingMetadata>)>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Ptr, otherwise None
Sourcepub fn as_ptr(
&self,
) -> Option<(&RefKind, &GlobalPlace, &Option<UnsizingMetadata>)>
pub fn as_ptr( &self, ) -> Option<(&RefKind, &GlobalPlace, &Option<UnsizingMetadata>)>
Optionally returns references to the inner fields if this is a ConstantExprKind::Ptr, otherwise None
Sourcepub fn into_ptr(
self,
) -> Result<(RefKind, GlobalPlace, Option<UnsizingMetadata>), Self>
pub fn into_ptr( self, ) -> Result<(RefKind, GlobalPlace, Option<UnsizingMetadata>), Self>
Returns the inner fields if this is a ConstantExprKind::Ptr, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_ptr_unchecked(
self,
) -> (RefKind, GlobalPlace, Option<UnsizingMetadata>)
pub unsafe fn into_ptr_unchecked( self, ) -> (RefKind, GlobalPlace, Option<UnsizingMetadata>)
Unchecked return of the inner fields of ConstantExprKind::Ptr.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_ptr_unchecked(
&self,
) -> (&RefKind, &GlobalPlace, &Option<UnsizingMetadata>)
pub unsafe fn as_ptr_unchecked( &self, ) -> (&RefKind, &GlobalPlace, &Option<UnsizingMetadata>)
Unchecked reference of the inner fields of ConstantExprKind::Ptr.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_ptr_mut_unchecked(
&mut self,
) -> (&mut RefKind, &mut GlobalPlace, &mut Option<UnsizingMetadata>)
pub unsafe fn as_ptr_mut_unchecked( &mut self, ) -> (&mut RefKind, &mut GlobalPlace, &mut Option<UnsizingMetadata>)
Unchecked mutable reference of the inner fields of ConstantExprKind::Ptr.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_str_mut(&mut self) -> Option<&mut String>
pub fn as_str_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Str, otherwise None
Sourcepub fn as_str(&self) -> Option<&String>
pub fn as_str(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a ConstantExprKind::Str, otherwise None
Sourcepub fn into_str(self) -> Result<String, Self>
pub fn into_str(self) -> Result<String, Self>
Returns the inner fields if this is a ConstantExprKind::Str, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_str_unchecked(self) -> String
pub unsafe fn into_str_unchecked(self) -> String
Unchecked return of the inner fields of ConstantExprKind::Str.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_str_unchecked(&self) -> &String
pub unsafe fn as_str_unchecked(&self) -> &String
Unchecked reference of the inner fields of ConstantExprKind::Str.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_str_mut_unchecked(&mut self) -> &mut String
pub unsafe fn as_str_mut_unchecked(&mut self) -> &mut String
Unchecked mutable reference of the inner fields of ConstantExprKind::Str.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_byte_str(&self) -> bool
pub fn is_byte_str(&self) -> bool
Returns true if this is a ConstantExprKind::ByteStr, otherwise false
Sourcepub fn as_byte_str_mut(&mut self) -> Option<&mut Vec<u8>>
pub fn as_byte_str_mut(&mut self) -> Option<&mut Vec<u8>>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::ByteStr, otherwise None
Sourcepub fn as_byte_str(&self) -> Option<&Vec<u8>>
pub fn as_byte_str(&self) -> Option<&Vec<u8>>
Optionally returns references to the inner fields if this is a ConstantExprKind::ByteStr, otherwise None
Sourcepub fn into_byte_str(self) -> Result<Vec<u8>, Self>
pub fn into_byte_str(self) -> Result<Vec<u8>, Self>
Returns the inner fields if this is a ConstantExprKind::ByteStr, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_byte_str_unchecked(self) -> Vec<u8> ⓘ
pub unsafe fn into_byte_str_unchecked(self) -> Vec<u8> ⓘ
Unchecked return of the inner fields of ConstantExprKind::ByteStr.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_byte_str_unchecked(&self) -> &Vec<u8> ⓘ
pub unsafe fn as_byte_str_unchecked(&self) -> &Vec<u8> ⓘ
Unchecked reference of the inner fields of ConstantExprKind::ByteStr.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_byte_str_mut_unchecked(&mut self) -> &mut Vec<u8> ⓘ
pub unsafe fn as_byte_str_mut_unchecked(&mut self) -> &mut Vec<u8> ⓘ
Unchecked mutable reference of the inner fields of ConstantExprKind::ByteStr.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_fn_def(&self) -> bool
pub fn is_fn_def(&self) -> bool
Returns true if this is a ConstantExprKind::FnDef, otherwise false
Sourcepub fn as_fn_def_mut(&mut self) -> Option<&mut FnPtr>
pub fn as_fn_def_mut(&mut self) -> Option<&mut FnPtr>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::FnDef, otherwise None
Sourcepub fn as_fn_def(&self) -> Option<&FnPtr>
pub fn as_fn_def(&self) -> Option<&FnPtr>
Optionally returns references to the inner fields if this is a ConstantExprKind::FnDef, otherwise None
Sourcepub fn into_fn_def(self) -> Result<FnPtr, Self>
pub fn into_fn_def(self) -> Result<FnPtr, Self>
Returns the inner fields if this is a ConstantExprKind::FnDef, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_fn_def_unchecked(self) -> FnPtr
pub unsafe fn into_fn_def_unchecked(self) -> FnPtr
Unchecked return of the inner fields of ConstantExprKind::FnDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_fn_def_unchecked(&self) -> &FnPtr
pub unsafe fn as_fn_def_unchecked(&self) -> &FnPtr
Unchecked reference of the inner fields of ConstantExprKind::FnDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_fn_def_mut_unchecked(&mut self) -> &mut FnPtr
pub unsafe fn as_fn_def_mut_unchecked(&mut self) -> &mut FnPtr
Unchecked mutable reference of the inner fields of ConstantExprKind::FnDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_fn_ptr(&self) -> bool
pub fn is_fn_ptr(&self) -> bool
Returns true if this is a ConstantExprKind::FnPtr, otherwise false
Sourcepub fn as_fn_ptr_mut(&mut self) -> Option<&mut FnPtr>
pub fn as_fn_ptr_mut(&mut self) -> Option<&mut FnPtr>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::FnPtr, otherwise None
Sourcepub fn as_fn_ptr(&self) -> Option<&FnPtr>
pub fn as_fn_ptr(&self) -> Option<&FnPtr>
Optionally returns references to the inner fields if this is a ConstantExprKind::FnPtr, otherwise None
Sourcepub fn into_fn_ptr(self) -> Result<FnPtr, Self>
pub fn into_fn_ptr(self) -> Result<FnPtr, Self>
Returns the inner fields if this is a ConstantExprKind::FnPtr, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_fn_ptr_unchecked(self) -> FnPtr
pub unsafe fn into_fn_ptr_unchecked(self) -> FnPtr
Unchecked return of the inner fields of ConstantExprKind::FnPtr.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_fn_ptr_unchecked(&self) -> &FnPtr
pub unsafe fn as_fn_ptr_unchecked(&self) -> &FnPtr
Unchecked reference of the inner fields of ConstantExprKind::FnPtr.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_fn_ptr_mut_unchecked(&mut self) -> &mut FnPtr
pub unsafe fn as_fn_ptr_mut_unchecked(&mut self) -> &mut FnPtr
Unchecked mutable reference of the inner fields of ConstantExprKind::FnPtr.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_cast(&self) -> bool
pub fn is_cast(&self) -> bool
Returns true if this is a ConstantExprKind::Cast, otherwise false
Sourcepub fn as_cast_mut(&mut self) -> Option<(&mut ConstantExpr, &mut CastKind)>
pub fn as_cast_mut(&mut self) -> Option<(&mut ConstantExpr, &mut CastKind)>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Cast, otherwise None
Sourcepub fn as_cast(&self) -> Option<(&ConstantExpr, &CastKind)>
pub fn as_cast(&self) -> Option<(&ConstantExpr, &CastKind)>
Optionally returns references to the inner fields if this is a ConstantExprKind::Cast, otherwise None
Sourcepub fn into_cast(self) -> Result<(ConstantExpr, CastKind), Self>
pub fn into_cast(self) -> Result<(ConstantExpr, CastKind), Self>
Returns the inner fields if this is a ConstantExprKind::Cast, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_cast_unchecked(self) -> (ConstantExpr, CastKind)
pub unsafe fn into_cast_unchecked(self) -> (ConstantExpr, CastKind)
Unchecked return of the inner fields of ConstantExprKind::Cast.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_cast_unchecked(&self) -> (&ConstantExpr, &CastKind)
pub unsafe fn as_cast_unchecked(&self) -> (&ConstantExpr, &CastKind)
Unchecked reference of the inner fields of ConstantExprKind::Cast.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_cast_mut_unchecked(
&mut self,
) -> (&mut ConstantExpr, &mut CastKind)
pub unsafe fn as_cast_mut_unchecked( &mut self, ) -> (&mut ConstantExpr, &mut CastKind)
Unchecked mutable reference of the inner fields of ConstantExprKind::Cast.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_ptr_no_provenance(&self) -> bool
pub fn is_ptr_no_provenance(&self) -> bool
Returns true if this is a ConstantExprKind::PtrNoProvenance, otherwise false
Sourcepub fn as_ptr_no_provenance_mut(&mut self) -> Option<&mut u128>
pub fn as_ptr_no_provenance_mut(&mut self) -> Option<&mut u128>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::PtrNoProvenance, otherwise None
Sourcepub fn as_ptr_no_provenance(&self) -> Option<&u128>
pub fn as_ptr_no_provenance(&self) -> Option<&u128>
Optionally returns references to the inner fields if this is a ConstantExprKind::PtrNoProvenance, otherwise None
Sourcepub fn into_ptr_no_provenance(self) -> Result<u128, Self>
pub fn into_ptr_no_provenance(self) -> Result<u128, Self>
Returns the inner fields if this is a ConstantExprKind::PtrNoProvenance, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_ptr_no_provenance_unchecked(self) -> u128
pub unsafe fn into_ptr_no_provenance_unchecked(self) -> u128
Unchecked return of the inner fields of ConstantExprKind::PtrNoProvenance.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_ptr_no_provenance_unchecked(&self) -> &u128
pub unsafe fn as_ptr_no_provenance_unchecked(&self) -> &u128
Unchecked reference of the inner fields of ConstantExprKind::PtrNoProvenance.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_ptr_no_provenance_mut_unchecked(&mut self) -> &mut u128
pub unsafe fn as_ptr_no_provenance_mut_unchecked(&mut self) -> &mut u128
Unchecked mutable reference of the inner fields of ConstantExprKind::PtrNoProvenance.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_extern_symbol(&self) -> bool
pub fn is_extern_symbol(&self) -> bool
Returns true if this is a ConstantExprKind::ExternSymbol, otherwise false
Sourcepub fn as_extern_symbol_mut(&mut self) -> Option<&mut String>
pub fn as_extern_symbol_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::ExternSymbol, otherwise None
Sourcepub fn as_extern_symbol(&self) -> Option<&String>
pub fn as_extern_symbol(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a ConstantExprKind::ExternSymbol, otherwise None
Sourcepub fn into_extern_symbol(self) -> Result<String, Self>
pub fn into_extern_symbol(self) -> Result<String, Self>
Returns the inner fields if this is a ConstantExprKind::ExternSymbol, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_extern_symbol_unchecked(self) -> String
pub unsafe fn into_extern_symbol_unchecked(self) -> String
Unchecked return of the inner fields of ConstantExprKind::ExternSymbol.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_extern_symbol_unchecked(&self) -> &String
pub unsafe fn as_extern_symbol_unchecked(&self) -> &String
Unchecked reference of the inner fields of ConstantExprKind::ExternSymbol.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_extern_symbol_mut_unchecked(&mut self) -> &mut String
pub unsafe fn as_extern_symbol_mut_unchecked(&mut self) -> &mut String
Unchecked mutable reference of the inner fields of ConstantExprKind::ExternSymbol.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_type_id(&self) -> bool
pub fn is_type_id(&self) -> bool
Returns true if this is a ConstantExprKind::TypeId, otherwise false
Sourcepub fn as_type_id_mut(&mut self) -> Option<&mut Ty>
pub fn as_type_id_mut(&mut self) -> Option<&mut Ty>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::TypeId, otherwise None
Sourcepub fn as_type_id(&self) -> Option<&Ty>
pub fn as_type_id(&self) -> Option<&Ty>
Optionally returns references to the inner fields if this is a ConstantExprKind::TypeId, otherwise None
Sourcepub fn into_type_id(self) -> Result<Ty, Self>
pub fn into_type_id(self) -> Result<Ty, Self>
Returns the inner fields if this is a ConstantExprKind::TypeId, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_type_id_unchecked(self) -> Ty
pub unsafe fn into_type_id_unchecked(self) -> Ty
Unchecked return of the inner fields of ConstantExprKind::TypeId.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_type_id_unchecked(&self) -> &Ty
pub unsafe fn as_type_id_unchecked(&self) -> &Ty
Unchecked reference of the inner fields of ConstantExprKind::TypeId.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_type_id_mut_unchecked(&mut self) -> &mut Ty
pub unsafe fn as_type_id_mut_unchecked(&mut self) -> &mut Ty
Unchecked mutable reference of the inner fields of ConstantExprKind::TypeId.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_raw_memory(&self) -> bool
pub fn is_raw_memory(&self) -> bool
Returns true if this is a ConstantExprKind::RawMemory, otherwise false
Sourcepub fn as_raw_memory_mut(&mut self) -> Option<&mut Vec<Byte>>
pub fn as_raw_memory_mut(&mut self) -> Option<&mut Vec<Byte>>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::RawMemory, otherwise None
Sourcepub fn as_raw_memory(&self) -> Option<&Vec<Byte>>
pub fn as_raw_memory(&self) -> Option<&Vec<Byte>>
Optionally returns references to the inner fields if this is a ConstantExprKind::RawMemory, otherwise None
Sourcepub fn into_raw_memory(self) -> Result<Vec<Byte>, Self>
pub fn into_raw_memory(self) -> Result<Vec<Byte>, Self>
Returns the inner fields if this is a ConstantExprKind::RawMemory, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_raw_memory_unchecked(self) -> Vec<Byte>
pub unsafe fn into_raw_memory_unchecked(self) -> Vec<Byte>
Unchecked return of the inner fields of ConstantExprKind::RawMemory.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_raw_memory_unchecked(&self) -> &Vec<Byte>
pub unsafe fn as_raw_memory_unchecked(&self) -> &Vec<Byte>
Unchecked reference of the inner fields of ConstantExprKind::RawMemory.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_raw_memory_mut_unchecked(&mut self) -> &mut Vec<Byte>
pub unsafe fn as_raw_memory_mut_unchecked(&mut self) -> &mut Vec<Byte>
Unchecked mutable reference of the inner fields of ConstantExprKind::RawMemory.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_var_mut(&mut self) -> Option<&mut ConstGenericDbVar>
pub fn as_var_mut(&mut self) -> Option<&mut ConstGenericDbVar>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Var, otherwise None
Sourcepub fn as_var(&self) -> Option<&ConstGenericDbVar>
pub fn as_var(&self) -> Option<&ConstGenericDbVar>
Optionally returns references to the inner fields if this is a ConstantExprKind::Var, otherwise None
Sourcepub fn into_var(self) -> Result<ConstGenericDbVar, Self>
pub fn into_var(self) -> Result<ConstGenericDbVar, Self>
Returns the inner fields if this is a ConstantExprKind::Var, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_var_unchecked(self) -> ConstGenericDbVar
pub unsafe fn into_var_unchecked(self) -> ConstGenericDbVar
Unchecked return of the inner fields of ConstantExprKind::Var.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_var_unchecked(&self) -> &ConstGenericDbVar
pub unsafe fn as_var_unchecked(&self) -> &ConstGenericDbVar
Unchecked reference of the inner fields of ConstantExprKind::Var.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_var_mut_unchecked(&mut self) -> &mut ConstGenericDbVar
pub unsafe fn as_var_mut_unchecked(&mut self) -> &mut ConstGenericDbVar
Unchecked mutable reference of the inner fields of ConstantExprKind::Var.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_global(&self) -> bool
pub fn is_global(&self) -> bool
Returns true if this is a ConstantExprKind::Global, otherwise false
Sourcepub fn as_global_mut(&mut self) -> Option<&mut GlobalDeclRef>
pub fn as_global_mut(&mut self) -> Option<&mut GlobalDeclRef>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Global, otherwise None
Sourcepub fn as_global(&self) -> Option<&GlobalDeclRef>
pub fn as_global(&self) -> Option<&GlobalDeclRef>
Optionally returns references to the inner fields if this is a ConstantExprKind::Global, otherwise None
Sourcepub fn into_global(self) -> Result<GlobalDeclRef, Self>
pub fn into_global(self) -> Result<GlobalDeclRef, Self>
Returns the inner fields if this is a ConstantExprKind::Global, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_global_unchecked(self) -> GlobalDeclRef
pub unsafe fn into_global_unchecked(self) -> GlobalDeclRef
Unchecked return of the inner fields of ConstantExprKind::Global.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_global_unchecked(&self) -> &GlobalDeclRef
pub unsafe fn as_global_unchecked(&self) -> &GlobalDeclRef
Unchecked reference of the inner fields of ConstantExprKind::Global.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_global_mut_unchecked(&mut self) -> &mut GlobalDeclRef
pub unsafe fn as_global_mut_unchecked(&mut self) -> &mut GlobalDeclRef
Unchecked mutable reference of the inner fields of ConstantExprKind::Global.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_call(&self) -> bool
pub fn is_call(&self) -> bool
Returns true if this is a ConstantExprKind::Call, otherwise false
Sourcepub fn as_call_mut(&mut self) -> Option<(&mut FnPtr, &mut Vec<ConstantExpr>)>
pub fn as_call_mut(&mut self) -> Option<(&mut FnPtr, &mut Vec<ConstantExpr>)>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Call, otherwise None
Sourcepub fn as_call(&self) -> Option<(&FnPtr, &Vec<ConstantExpr>)>
pub fn as_call(&self) -> Option<(&FnPtr, &Vec<ConstantExpr>)>
Optionally returns references to the inner fields if this is a ConstantExprKind::Call, otherwise None
Sourcepub fn into_call(self) -> Result<(FnPtr, Vec<ConstantExpr>), Self>
pub fn into_call(self) -> Result<(FnPtr, Vec<ConstantExpr>), Self>
Returns the inner fields if this is a ConstantExprKind::Call, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_call_unchecked(self) -> (FnPtr, Vec<ConstantExpr>)
pub unsafe fn into_call_unchecked(self) -> (FnPtr, Vec<ConstantExpr>)
Unchecked return of the inner fields of ConstantExprKind::Call.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_call_unchecked(&self) -> (&FnPtr, &Vec<ConstantExpr>)
pub unsafe fn as_call_unchecked(&self) -> (&FnPtr, &Vec<ConstantExpr>)
Unchecked reference of the inner fields of ConstantExprKind::Call.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_call_mut_unchecked(
&mut self,
) -> (&mut FnPtr, &mut Vec<ConstantExpr>)
pub unsafe fn as_call_mut_unchecked( &mut self, ) -> (&mut FnPtr, &mut Vec<ConstantExpr>)
Unchecked mutable reference of the inner fields of ConstantExprKind::Call.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_trait_const(&self) -> bool
pub fn is_trait_const(&self) -> bool
Returns true if this is a ConstantExprKind::TraitConst, otherwise false
Sourcepub fn as_trait_const_mut(
&mut self,
) -> Option<(&mut TraitRef, &mut AssocConstId)>
pub fn as_trait_const_mut( &mut self, ) -> Option<(&mut TraitRef, &mut AssocConstId)>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::TraitConst, otherwise None
Sourcepub fn as_trait_const(&self) -> Option<(&TraitRef, &AssocConstId)>
pub fn as_trait_const(&self) -> Option<(&TraitRef, &AssocConstId)>
Optionally returns references to the inner fields if this is a ConstantExprKind::TraitConst, otherwise None
Sourcepub fn into_trait_const(self) -> Result<(TraitRef, AssocConstId), Self>
pub fn into_trait_const(self) -> Result<(TraitRef, AssocConstId), Self>
Returns the inner fields if this is a ConstantExprKind::TraitConst, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_trait_const_unchecked(self) -> (TraitRef, AssocConstId)
pub unsafe fn into_trait_const_unchecked(self) -> (TraitRef, AssocConstId)
Unchecked return of the inner fields of ConstantExprKind::TraitConst.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_trait_const_unchecked(&self) -> (&TraitRef, &AssocConstId)
pub unsafe fn as_trait_const_unchecked(&self) -> (&TraitRef, &AssocConstId)
Unchecked reference of the inner fields of ConstantExprKind::TraitConst.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_trait_const_mut_unchecked(
&mut self,
) -> (&mut TraitRef, &mut AssocConstId)
pub unsafe fn as_trait_const_mut_unchecked( &mut self, ) -> (&mut TraitRef, &mut AssocConstId)
Unchecked mutable reference of the inner fields of ConstantExprKind::TraitConst.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_v_table_ref(&self) -> bool
pub fn is_v_table_ref(&self) -> bool
Returns true if this is a ConstantExprKind::VTableRef, otherwise false
Sourcepub fn as_v_table_ref_mut(&mut self) -> Option<&mut PolyTraitRef>
pub fn as_v_table_ref_mut(&mut self) -> Option<&mut PolyTraitRef>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::VTableRef, otherwise None
Sourcepub fn as_v_table_ref(&self) -> Option<&PolyTraitRef>
pub fn as_v_table_ref(&self) -> Option<&PolyTraitRef>
Optionally returns references to the inner fields if this is a ConstantExprKind::VTableRef, otherwise None
Sourcepub fn into_v_table_ref(self) -> Result<PolyTraitRef, Self>
pub fn into_v_table_ref(self) -> Result<PolyTraitRef, Self>
Returns the inner fields if this is a ConstantExprKind::VTableRef, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_v_table_ref_unchecked(self) -> PolyTraitRef
pub unsafe fn into_v_table_ref_unchecked(self) -> PolyTraitRef
Unchecked return of the inner fields of ConstantExprKind::VTableRef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_v_table_ref_unchecked(&self) -> &PolyTraitRef
pub unsafe fn as_v_table_ref_unchecked(&self) -> &PolyTraitRef
Unchecked reference of the inner fields of ConstantExprKind::VTableRef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_v_table_ref_mut_unchecked(&mut self) -> &mut PolyTraitRef
pub unsafe fn as_v_table_ref_mut_unchecked(&mut self) -> &mut PolyTraitRef
Unchecked mutable reference of the inner fields of ConstantExprKind::VTableRef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_discriminant(&self) -> bool
pub fn is_discriminant(&self) -> bool
Returns true if this is a ConstantExprKind::Discriminant, otherwise false
Sourcepub fn as_discriminant_mut(
&mut self,
) -> Option<(&mut TypeDeclRef, &mut VariantId)>
pub fn as_discriminant_mut( &mut self, ) -> Option<(&mut TypeDeclRef, &mut VariantId)>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Discriminant, otherwise None
Sourcepub fn as_discriminant(&self) -> Option<(&TypeDeclRef, &VariantId)>
pub fn as_discriminant(&self) -> Option<(&TypeDeclRef, &VariantId)>
Optionally returns references to the inner fields if this is a ConstantExprKind::Discriminant, otherwise None
Sourcepub fn into_discriminant(self) -> Result<(TypeDeclRef, VariantId), Self>
pub fn into_discriminant(self) -> Result<(TypeDeclRef, VariantId), Self>
Returns the inner fields if this is a ConstantExprKind::Discriminant, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_discriminant_unchecked(self) -> (TypeDeclRef, VariantId)
pub unsafe fn into_discriminant_unchecked(self) -> (TypeDeclRef, VariantId)
Unchecked return of the inner fields of ConstantExprKind::Discriminant.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_discriminant_unchecked(&self) -> (&TypeDeclRef, &VariantId)
pub unsafe fn as_discriminant_unchecked(&self) -> (&TypeDeclRef, &VariantId)
Unchecked reference of the inner fields of ConstantExprKind::Discriminant.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_discriminant_mut_unchecked(
&mut self,
) -> (&mut TypeDeclRef, &mut VariantId)
pub unsafe fn as_discriminant_mut_unchecked( &mut self, ) -> (&mut TypeDeclRef, &mut VariantId)
Unchecked mutable reference of the inner fields of ConstantExprKind::Discriminant.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_repeat(&self) -> bool
pub fn is_repeat(&self) -> bool
Returns true if this is a ConstantExprKind::Repeat, otherwise false
Sourcepub fn as_repeat_mut(
&mut self,
) -> Option<(&mut ConstantExpr, &mut ConstantExpr, &mut Option<TraitRef>)>
pub fn as_repeat_mut( &mut self, ) -> Option<(&mut ConstantExpr, &mut ConstantExpr, &mut Option<TraitRef>)>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Repeat, otherwise None
Sourcepub fn as_repeat(
&self,
) -> Option<(&ConstantExpr, &ConstantExpr, &Option<TraitRef>)>
pub fn as_repeat( &self, ) -> Option<(&ConstantExpr, &ConstantExpr, &Option<TraitRef>)>
Optionally returns references to the inner fields if this is a ConstantExprKind::Repeat, otherwise None
Sourcepub fn into_repeat(
self,
) -> Result<(ConstantExpr, ConstantExpr, Option<TraitRef>), Self>
pub fn into_repeat( self, ) -> Result<(ConstantExpr, ConstantExpr, Option<TraitRef>), Self>
Returns the inner fields if this is a ConstantExprKind::Repeat, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_repeat_unchecked(
self,
) -> (ConstantExpr, ConstantExpr, Option<TraitRef>)
pub unsafe fn into_repeat_unchecked( self, ) -> (ConstantExpr, ConstantExpr, Option<TraitRef>)
Unchecked return of the inner fields of ConstantExprKind::Repeat.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_repeat_unchecked(
&self,
) -> (&ConstantExpr, &ConstantExpr, &Option<TraitRef>)
pub unsafe fn as_repeat_unchecked( &self, ) -> (&ConstantExpr, &ConstantExpr, &Option<TraitRef>)
Unchecked reference of the inner fields of ConstantExprKind::Repeat.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_repeat_mut_unchecked(
&mut self,
) -> (&mut ConstantExpr, &mut ConstantExpr, &mut Option<TraitRef>)
pub unsafe fn as_repeat_mut_unchecked( &mut self, ) -> (&mut ConstantExpr, &mut ConstantExpr, &mut Option<TraitRef>)
Unchecked mutable reference of the inner fields of ConstantExprKind::Repeat.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_size_of(&self) -> bool
pub fn is_size_of(&self) -> bool
Returns true if this is a ConstantExprKind::SizeOf, otherwise false
Sourcepub fn as_size_of_mut(&mut self) -> Option<&mut Ty>
pub fn as_size_of_mut(&mut self) -> Option<&mut Ty>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::SizeOf, otherwise None
Sourcepub fn as_size_of(&self) -> Option<&Ty>
pub fn as_size_of(&self) -> Option<&Ty>
Optionally returns references to the inner fields if this is a ConstantExprKind::SizeOf, otherwise None
Sourcepub fn into_size_of(self) -> Result<Ty, Self>
pub fn into_size_of(self) -> Result<Ty, Self>
Returns the inner fields if this is a ConstantExprKind::SizeOf, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_size_of_unchecked(self) -> Ty
pub unsafe fn into_size_of_unchecked(self) -> Ty
Unchecked return of the inner fields of ConstantExprKind::SizeOf.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_size_of_unchecked(&self) -> &Ty
pub unsafe fn as_size_of_unchecked(&self) -> &Ty
Unchecked reference of the inner fields of ConstantExprKind::SizeOf.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_size_of_mut_unchecked(&mut self) -> &mut Ty
pub unsafe fn as_size_of_mut_unchecked(&mut self) -> &mut Ty
Unchecked mutable reference of the inner fields of ConstantExprKind::SizeOf.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_align_of(&self) -> bool
pub fn is_align_of(&self) -> bool
Returns true if this is a ConstantExprKind::AlignOf, otherwise false
Sourcepub fn as_align_of_mut(&mut self) -> Option<&mut Ty>
pub fn as_align_of_mut(&mut self) -> Option<&mut Ty>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::AlignOf, otherwise None
Sourcepub fn as_align_of(&self) -> Option<&Ty>
pub fn as_align_of(&self) -> Option<&Ty>
Optionally returns references to the inner fields if this is a ConstantExprKind::AlignOf, otherwise None
Sourcepub fn into_align_of(self) -> Result<Ty, Self>
pub fn into_align_of(self) -> Result<Ty, Self>
Returns the inner fields if this is a ConstantExprKind::AlignOf, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_align_of_unchecked(self) -> Ty
pub unsafe fn into_align_of_unchecked(self) -> Ty
Unchecked return of the inner fields of ConstantExprKind::AlignOf.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_align_of_unchecked(&self) -> &Ty
pub unsafe fn as_align_of_unchecked(&self) -> &Ty
Unchecked reference of the inner fields of ConstantExprKind::AlignOf.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_align_of_mut_unchecked(&mut self) -> &mut Ty
pub unsafe fn as_align_of_mut_unchecked(&mut self) -> &mut Ty
Unchecked mutable reference of the inner fields of ConstantExprKind::AlignOf.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_offset_of(&self) -> bool
pub fn is_offset_of(&self) -> bool
Returns true if this is a ConstantExprKind::OffsetOf, otherwise false
Sourcepub fn as_offset_of_mut(
&mut self,
) -> Option<(&mut TypeDeclRef, &mut Option<VariantId>, &mut FieldId)>
pub fn as_offset_of_mut( &mut self, ) -> Option<(&mut TypeDeclRef, &mut Option<VariantId>, &mut FieldId)>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::OffsetOf, otherwise None
Sourcepub fn as_offset_of(
&self,
) -> Option<(&TypeDeclRef, &Option<VariantId>, &FieldId)>
pub fn as_offset_of( &self, ) -> Option<(&TypeDeclRef, &Option<VariantId>, &FieldId)>
Optionally returns references to the inner fields if this is a ConstantExprKind::OffsetOf, otherwise None
Sourcepub fn into_offset_of(
self,
) -> Result<(TypeDeclRef, Option<VariantId>, FieldId), Self>
pub fn into_offset_of( self, ) -> Result<(TypeDeclRef, Option<VariantId>, FieldId), Self>
Returns the inner fields if this is a ConstantExprKind::OffsetOf, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_offset_of_unchecked(
self,
) -> (TypeDeclRef, Option<VariantId>, FieldId)
pub unsafe fn into_offset_of_unchecked( self, ) -> (TypeDeclRef, Option<VariantId>, FieldId)
Unchecked return of the inner fields of ConstantExprKind::OffsetOf.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_offset_of_unchecked(
&self,
) -> (&TypeDeclRef, &Option<VariantId>, &FieldId)
pub unsafe fn as_offset_of_unchecked( &self, ) -> (&TypeDeclRef, &Option<VariantId>, &FieldId)
Unchecked reference of the inner fields of ConstantExprKind::OffsetOf.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_offset_of_mut_unchecked(
&mut self,
) -> (&mut TypeDeclRef, &mut Option<VariantId>, &mut FieldId)
pub unsafe fn as_offset_of_mut_unchecked( &mut self, ) -> (&mut TypeDeclRef, &mut Option<VariantId>, &mut FieldId)
Unchecked mutable reference of the inner fields of ConstantExprKind::OffsetOf.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_opaque(&self) -> bool
pub fn is_opaque(&self) -> bool
Returns true if this is a ConstantExprKind::Opaque, otherwise false
Sourcepub fn as_opaque_mut(&mut self) -> Option<&mut String>
pub fn as_opaque_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a ConstantExprKind::Opaque, otherwise None
Sourcepub fn as_opaque(&self) -> Option<&String>
pub fn as_opaque(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a ConstantExprKind::Opaque, otherwise None
Sourcepub fn into_opaque(self) -> Result<String, Self>
pub fn into_opaque(self) -> Result<String, Self>
Returns the inner fields if this is a ConstantExprKind::Opaque, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_opaque_unchecked(self) -> String
pub unsafe fn into_opaque_unchecked(self) -> String
Unchecked return of the inner fields of ConstantExprKind::Opaque.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_opaque_unchecked(&self) -> &String
pub unsafe fn as_opaque_unchecked(&self) -> &String
Unchecked reference of the inner fields of ConstantExprKind::Opaque.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_opaque_mut_unchecked(&mut self) -> &mut String
pub unsafe fn as_opaque_mut_unchecked(&mut self) -> &mut String
Unchecked mutable reference of the inner fields of ConstantExprKind::Opaque.
§Safety
Results in undefined behavior when it is the incorrect variant.
Trait Implementations§
Source§impl AstVisitable for ConstantExprKind
impl AstVisitable for ConstantExprKind
Source§fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>
fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>
visit_$any
method if it exists, otherwise visit_inner.Source§fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>
fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>
visit_$any
method if it exists, otherwise visit_inner.Source§fn drive_two<V: ZipAst>(&self, other: &Self, v: &mut V) -> ControlFlow<V::Break>
fn drive_two<V: ZipAst>(&self, other: &Self, v: &mut V) -> ControlFlow<V::Break>
visit_$any
method if it exists, otherwise visit_inner.Source§fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))where
Self: Sized,
fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))where
Self: Sized,
self, in pre-order traversal.Source§fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))where
Self: Sized,
fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))where
Self: Sized,
self, in pre-order traversal.Source§impl Clone for ConstantExprKind
impl Clone for ConstantExprKind
Source§fn clone(&self) -> ConstantExprKind
fn clone(&self) -> ConstantExprKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConstantExprKind
impl Debug for ConstantExprKind
Source§impl<'de, __State: ?Sized> DeserializeState<'de, __State> for ConstantExprKindwhere
bool: DeserializeState<'de, __State>,
IntegerValue: Deserialize<'de>,
char: DeserializeState<'de, __State>,
FloatValue: Deserialize<'de>,
Option<VariantId>: DeserializeState<'de, __State>,
IndexVec<FieldId, ConstantExpr>: DeserializeState<'de, __State>,
Vec<ConstantExpr>: DeserializeState<'de, __State>,
GlobalPlace: DeserializeState<'de, __State>,
Option<UnsizingMetadata>: DeserializeState<'de, __State>,
RefKind: DeserializeState<'de, __State>,
String: DeserializeState<'de, __State>,
Vec<u8>: DeserializeState<'de, __State>,
FnPtr: DeserializeState<'de, __State>,
ConstantExpr: DeserializeState<'de, __State>,
CastKind: DeserializeState<'de, __State>,
u128: DeserializeState<'de, __State>,
Ty: DeserializeState<'de, __State>,
Vec<Byte>: DeserializeState<'de, __State>,
ConstGenericDbVar: DeserializeState<'de, __State>,
GlobalDeclRef: DeserializeState<'de, __State>,
TraitRef: DeserializeState<'de, __State>,
AssocConstId: DeserializeState<'de, __State>,
PolyTraitRef: DeserializeState<'de, __State>,
TypeDeclRef: DeserializeState<'de, __State>,
VariantId: DeserializeState<'de, __State>,
Option<TraitRef>: DeserializeState<'de, __State>,
FieldId: DeserializeState<'de, __State>,
impl<'de, __State: ?Sized> DeserializeState<'de, __State> for ConstantExprKindwhere
bool: DeserializeState<'de, __State>,
IntegerValue: Deserialize<'de>,
char: DeserializeState<'de, __State>,
FloatValue: Deserialize<'de>,
Option<VariantId>: DeserializeState<'de, __State>,
IndexVec<FieldId, ConstantExpr>: DeserializeState<'de, __State>,
Vec<ConstantExpr>: DeserializeState<'de, __State>,
GlobalPlace: DeserializeState<'de, __State>,
Option<UnsizingMetadata>: DeserializeState<'de, __State>,
RefKind: DeserializeState<'de, __State>,
String: DeserializeState<'de, __State>,
Vec<u8>: DeserializeState<'de, __State>,
FnPtr: DeserializeState<'de, __State>,
ConstantExpr: DeserializeState<'de, __State>,
CastKind: DeserializeState<'de, __State>,
u128: DeserializeState<'de, __State>,
Ty: DeserializeState<'de, __State>,
Vec<Byte>: DeserializeState<'de, __State>,
ConstGenericDbVar: DeserializeState<'de, __State>,
GlobalDeclRef: DeserializeState<'de, __State>,
TraitRef: DeserializeState<'de, __State>,
AssocConstId: DeserializeState<'de, __State>,
PolyTraitRef: DeserializeState<'de, __State>,
TypeDeclRef: DeserializeState<'de, __State>,
VariantId: DeserializeState<'de, __State>,
Option<TraitRef>: DeserializeState<'de, __State>,
FieldId: DeserializeState<'de, __State>,
fn deserialize_state<__D>(
__state: &__State,
__deserializer: __D,
) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'s, V> Drive<'s, V> for ConstantExprKindwhere
V: Visitor + Visit<'s, bool> + Visit<'s, IntegerValue> + Visit<'s, char> + Visit<'s, FloatValue> + Visit<'s, Option<VariantId>> + Visit<'s, IndexVec<FieldId, ConstantExpr>> + Visit<'s, Vec<ConstantExpr>> + Visit<'s, GlobalPlace> + Visit<'s, Option<UnsizingMetadata>> + Visit<'s, RefKind> + Visit<'s, String> + Visit<'s, Vec<u8>> + Visit<'s, FnPtr> + Visit<'s, ConstantExpr> + Visit<'s, CastKind> + Visit<'s, u128> + Visit<'s, Ty> + Visit<'s, Vec<Byte>> + Visit<'s, ConstGenericDbVar> + Visit<'s, GlobalDeclRef> + Visit<'s, TraitRef> + Visit<'s, AssocConstId> + Visit<'s, PolyTraitRef> + Visit<'s, TypeDeclRef> + Visit<'s, VariantId> + Visit<'s, Option<TraitRef>> + Visit<'s, FieldId>,
impl<'s, V> Drive<'s, V> for ConstantExprKindwhere
V: Visitor + Visit<'s, bool> + Visit<'s, IntegerValue> + Visit<'s, char> + Visit<'s, FloatValue> + Visit<'s, Option<VariantId>> + Visit<'s, IndexVec<FieldId, ConstantExpr>> + Visit<'s, Vec<ConstantExpr>> + Visit<'s, GlobalPlace> + Visit<'s, Option<UnsizingMetadata>> + Visit<'s, RefKind> + Visit<'s, String> + Visit<'s, Vec<u8>> + Visit<'s, FnPtr> + Visit<'s, ConstantExpr> + Visit<'s, CastKind> + Visit<'s, u128> + Visit<'s, Ty> + Visit<'s, Vec<Byte>> + Visit<'s, ConstGenericDbVar> + Visit<'s, GlobalDeclRef> + Visit<'s, TraitRef> + Visit<'s, AssocConstId> + Visit<'s, PolyTraitRef> + Visit<'s, TypeDeclRef> + Visit<'s, VariantId> + Visit<'s, Option<TraitRef>> + Visit<'s, FieldId>,
Source§fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
v.visit() on the immediate contents of self.Source§impl<'s, V> DriveMut<'s, V> for ConstantExprKindwhere
V: Visitor + VisitMut<'s, bool> + VisitMut<'s, IntegerValue> + VisitMut<'s, char> + VisitMut<'s, FloatValue> + VisitMut<'s, Option<VariantId>> + VisitMut<'s, IndexVec<FieldId, ConstantExpr>> + VisitMut<'s, Vec<ConstantExpr>> + VisitMut<'s, GlobalPlace> + VisitMut<'s, Option<UnsizingMetadata>> + VisitMut<'s, RefKind> + VisitMut<'s, String> + VisitMut<'s, Vec<u8>> + VisitMut<'s, FnPtr> + VisitMut<'s, ConstantExpr> + VisitMut<'s, CastKind> + VisitMut<'s, u128> + VisitMut<'s, Ty> + VisitMut<'s, Vec<Byte>> + VisitMut<'s, ConstGenericDbVar> + VisitMut<'s, GlobalDeclRef> + VisitMut<'s, TraitRef> + VisitMut<'s, AssocConstId> + VisitMut<'s, PolyTraitRef> + VisitMut<'s, TypeDeclRef> + VisitMut<'s, VariantId> + VisitMut<'s, Option<TraitRef>> + VisitMut<'s, FieldId>,
impl<'s, V> DriveMut<'s, V> for ConstantExprKindwhere
V: Visitor + VisitMut<'s, bool> + VisitMut<'s, IntegerValue> + VisitMut<'s, char> + VisitMut<'s, FloatValue> + VisitMut<'s, Option<VariantId>> + VisitMut<'s, IndexVec<FieldId, ConstantExpr>> + VisitMut<'s, Vec<ConstantExpr>> + VisitMut<'s, GlobalPlace> + VisitMut<'s, Option<UnsizingMetadata>> + VisitMut<'s, RefKind> + VisitMut<'s, String> + VisitMut<'s, Vec<u8>> + VisitMut<'s, FnPtr> + VisitMut<'s, ConstantExpr> + VisitMut<'s, CastKind> + VisitMut<'s, u128> + VisitMut<'s, Ty> + VisitMut<'s, Vec<Byte>> + VisitMut<'s, ConstGenericDbVar> + VisitMut<'s, GlobalDeclRef> + VisitMut<'s, TraitRef> + VisitMut<'s, AssocConstId> + VisitMut<'s, PolyTraitRef> + VisitMut<'s, TypeDeclRef> + VisitMut<'s, VariantId> + VisitMut<'s, Option<TraitRef>> + VisitMut<'s, FieldId>,
Source§fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
v.visit() on the immediate contents of self.Source§impl<'s, V> DriveTwo<'s, V> for ConstantExprKindwhere
V: Visitor<Break: Default> + VisitTwo<'s, bool> + VisitTwo<'s, IntegerValue> + VisitTwo<'s, char> + VisitTwo<'s, FloatValue> + VisitTwo<'s, Option<VariantId>> + VisitTwo<'s, IndexVec<FieldId, ConstantExpr>> + VisitTwo<'s, Vec<ConstantExpr>> + VisitTwo<'s, GlobalPlace> + VisitTwo<'s, Option<UnsizingMetadata>> + VisitTwo<'s, RefKind> + VisitTwo<'s, String> + VisitTwo<'s, Vec<u8>> + VisitTwo<'s, FnPtr> + VisitTwo<'s, ConstantExpr> + VisitTwo<'s, CastKind> + VisitTwo<'s, u128> + VisitTwo<'s, Ty> + VisitTwo<'s, Vec<Byte>> + VisitTwo<'s, ConstGenericDbVar> + VisitTwo<'s, GlobalDeclRef> + VisitTwo<'s, TraitRef> + VisitTwo<'s, AssocConstId> + VisitTwo<'s, PolyTraitRef> + VisitTwo<'s, TypeDeclRef> + VisitTwo<'s, VariantId> + VisitTwo<'s, Option<TraitRef>> + VisitTwo<'s, FieldId>,
impl<'s, V> DriveTwo<'s, V> for ConstantExprKindwhere
V: Visitor<Break: Default> + VisitTwo<'s, bool> + VisitTwo<'s, IntegerValue> + VisitTwo<'s, char> + VisitTwo<'s, FloatValue> + VisitTwo<'s, Option<VariantId>> + VisitTwo<'s, IndexVec<FieldId, ConstantExpr>> + VisitTwo<'s, Vec<ConstantExpr>> + VisitTwo<'s, GlobalPlace> + VisitTwo<'s, Option<UnsizingMetadata>> + VisitTwo<'s, RefKind> + VisitTwo<'s, String> + VisitTwo<'s, Vec<u8>> + VisitTwo<'s, FnPtr> + VisitTwo<'s, ConstantExpr> + VisitTwo<'s, CastKind> + VisitTwo<'s, u128> + VisitTwo<'s, Ty> + VisitTwo<'s, Vec<Byte>> + VisitTwo<'s, ConstGenericDbVar> + VisitTwo<'s, GlobalDeclRef> + VisitTwo<'s, TraitRef> + VisitTwo<'s, AssocConstId> + VisitTwo<'s, PolyTraitRef> + VisitTwo<'s, TypeDeclRef> + VisitTwo<'s, VariantId> + VisitTwo<'s, Option<TraitRef>> + VisitTwo<'s, FieldId>,
Source§fn drive_two_inner(
&'s self,
other: &'s Self,
visitor: &mut V,
) -> ControlFlow<V::Break>
fn drive_two_inner( &'s self, other: &'s Self, visitor: &mut V, ) -> ControlFlow<V::Break>
v.visit() on the immediate contents of self and other, if they correspond. If
the values don’t match up, this returns Break(Default::default()).impl Eq for ConstantExprKind
Source§impl From<DeBruijnVar<ConstGenericVarId>> for ConstantExprKind
impl From<DeBruijnVar<ConstGenericVarId>> for ConstantExprKind
Source§fn from(x: ConstGenericDbVar) -> Self
fn from(x: ConstGenericDbVar) -> Self
Source§impl Hash for ConstantExprKind
impl Hash for ConstantExprKind
Source§impl Ord for ConstantExprKind
impl Ord for ConstantExprKind
Source§fn cmp(&self, other: &ConstantExprKind) -> Ordering
fn cmp(&self, other: &ConstantExprKind) -> Ordering
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,
Source§impl PartialEq for ConstantExprKind
impl PartialEq for ConstantExprKind
Source§impl PartialOrd for ConstantExprKind
impl PartialOrd for ConstantExprKind
Source§impl<__State: ?Sized> SerializeState<__State> for ConstantExprKindwhere
bool: SerializeState<__State>,
IntegerValue: Serialize,
char: SerializeState<__State>,
FloatValue: Serialize,
Option<VariantId>: SerializeState<__State>,
IndexVec<FieldId, ConstantExpr>: SerializeState<__State>,
Vec<ConstantExpr>: SerializeState<__State>,
GlobalPlace: SerializeState<__State>,
Option<UnsizingMetadata>: SerializeState<__State>,
RefKind: SerializeState<__State>,
String: SerializeState<__State>,
Vec<u8>: SerializeState<__State>,
FnPtr: SerializeState<__State>,
ConstantExpr: SerializeState<__State>,
CastKind: SerializeState<__State>,
u128: SerializeState<__State>,
Ty: SerializeState<__State>,
Vec<Byte>: SerializeState<__State>,
ConstGenericDbVar: SerializeState<__State>,
GlobalDeclRef: SerializeState<__State>,
TraitRef: SerializeState<__State>,
AssocConstId: SerializeState<__State>,
PolyTraitRef: SerializeState<__State>,
TypeDeclRef: SerializeState<__State>,
VariantId: SerializeState<__State>,
Option<TraitRef>: SerializeState<__State>,
FieldId: SerializeState<__State>,
impl<__State: ?Sized> SerializeState<__State> for ConstantExprKindwhere
bool: SerializeState<__State>,
IntegerValue: Serialize,
char: SerializeState<__State>,
FloatValue: Serialize,
Option<VariantId>: SerializeState<__State>,
IndexVec<FieldId, ConstantExpr>: SerializeState<__State>,
Vec<ConstantExpr>: SerializeState<__State>,
GlobalPlace: SerializeState<__State>,
Option<UnsizingMetadata>: SerializeState<__State>,
RefKind: SerializeState<__State>,
String: SerializeState<__State>,
Vec<u8>: SerializeState<__State>,
FnPtr: SerializeState<__State>,
ConstantExpr: SerializeState<__State>,
CastKind: SerializeState<__State>,
u128: SerializeState<__State>,
Ty: SerializeState<__State>,
Vec<Byte>: SerializeState<__State>,
ConstGenericDbVar: SerializeState<__State>,
GlobalDeclRef: SerializeState<__State>,
TraitRef: SerializeState<__State>,
AssocConstId: SerializeState<__State>,
PolyTraitRef: SerializeState<__State>,
TypeDeclRef: SerializeState<__State>,
VariantId: SerializeState<__State>,
Option<TraitRef>: SerializeState<__State>,
FieldId: SerializeState<__State>,
fn serialize_state<__S>(
&self,
__state: &__State,
__serializer: __S,
) -> Result<__S::Ok, __S::Error>where
__S: Serializer,
impl StructuralPartialEq for ConstantExprKind
Source§impl TryFrom<ConstantExprKind> for ConstGenericDbVar
impl TryFrom<ConstantExprKind> for ConstGenericDbVar
Auto Trait Implementations§
impl Freeze for ConstantExprKind
impl RefUnwindSafe for ConstantExprKind
impl Send for ConstantExprKind
impl Sync for ConstantExprKind
impl Unpin for ConstantExprKind
impl UnsafeUnpin for ConstantExprKind
impl UnwindSafe for ConstantExprKind
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> Dedup for T
§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> HashConsable 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> ⓘ
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 moreimpl<T> Mappable for T
Source§impl<T> TyVisitable for Twhere
T: AstVisitable,
impl<T> TyVisitable for Twhere
T: AstVisitable,
Source§fn type_info(&self) -> TypeInfo
fn type_info(&self) -> TypeInfo
TypeInfo.Source§fn visit_vars(&mut self, v: &mut impl VarsVisitor)
fn visit_vars(&mut self, v: &mut impl VarsVisitor)
self, as seen from the outside of self. This means
that any variable bound inside self will be skipped, and all the seen De Bruijn indices
will count from the outside of self.Source§fn substitute(self, generics: &GenericArgs) -> Self
fn substitute(self, generics: &GenericArgs) -> Self
self by replacing them with the provided values.
Note: if self is an item that comes from a TraitDecl, you must use
substitute_with_self or substitute_inner_binder, otherwise you’ll get panics.Source§fn substitute_inner_binder(self, generics: &GenericArgs) -> Self
fn substitute_inner_binder(self, generics: &GenericArgs) -> Self
self by replacing them with the provided values.
This is appropriate when substituting an inner binder.Source§fn substitute_explicits(self, generics: &GenericArgs) -> Self
fn substitute_explicits(self, generics: &GenericArgs) -> Self
Source§fn substitute_with_self(
self,
generics: &GenericArgs,
self_ref: &TraitRefKind,
) -> Self
fn substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Self
TraitRefKind::SelfId trait ref.Source§fn substitute_with_tref(self, tref: &TraitRef) -> Self
fn substitute_with_tref(self, tref: &TraitRef) -> Self
TraitRefKind::SelfId trait ref.Source§fn try_substitute_with_tref(
self,
tref: &TraitRef,
) -> Result<Self, GenericsMismatch>
fn try_substitute_with_tref( self, tref: &TraitRef, ) -> Result<Self, GenericsMismatch>
TraitRefKind::SelfId trait ref.fn try_substitute( self, generics: &GenericArgs, ) -> Result<Self, GenericsMismatch>
fn try_substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Result<Self, GenericsMismatch>
Source§fn move_under_binder(self) -> Self
fn move_under_binder(self) -> Self
Source§fn move_under_binders(self, depth: DeBruijnId) -> Self
fn move_under_binders(self, depth: DeBruijnId) -> Self
depth binders.Source§fn move_from_under_binder(self) -> Option<Self>
fn move_from_under_binder(self) -> Option<Self>
Source§fn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self>
fn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self>
depth binders. Returns None if it contains a variable bound in
one of these depth binders.Source§fn visit_db_id<B>(
&mut self,
f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>,
) -> ControlFlow<B>
fn visit_db_id<B>( &mut self, f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>, ) -> ControlFlow<B>
self, as seen from the outside of self. This means
that any variable bound inside self will be skipped, and all the seen indices will count
from the outside of self.Source§fn has_escaping_region_var(&self) -> bool
fn has_escaping_region_var(&self) -> bool
Source§fn collect_regions(&self) -> SeqHashSet<Region>
fn collect_regions(&self) -> SeqHashSet<Region>
self.