pub struct Type(pub DefaultKey);
Tuple Fields§
§0: DefaultKey
Implementations§
Source§impl Type
impl Type
Sourcepub fn get_type(context: &Context<'_>, t: &TypeContent) -> Option<Type>
pub fn get_type(context: &Context<'_>, t: &TypeContent) -> Option<Type>
Get Type if it already exists.
pub fn create_basic_types(context: &mut Context<'_>)
Sourcepub fn get_content<'a>(&self, context: &'a Context<'_>) -> &'a TypeContent
pub fn get_content<'a>(&self, context: &'a Context<'_>) -> &'a TypeContent
Get the content for this Type.
Sourcepub fn get_uint16(context: &Context<'_>) -> Type
pub fn get_uint16(context: &Context<'_>) -> Type
New u16 type
Sourcepub fn get_uint32(context: &Context<'_>) -> Type
pub fn get_uint32(context: &Context<'_>) -> Type
New u32 type
Sourcepub fn get_uint64(context: &Context<'_>) -> Type
pub fn get_uint64(context: &Context<'_>) -> Type
New u64 type
Sourcepub fn get_uint256(context: &Context<'_>) -> Type
pub fn get_uint256(context: &Context<'_>) -> Type
New u64 type
Sourcepub fn new_string_array(context: &mut Context<'_>, len: u64) -> Type
pub fn new_string_array(context: &mut Context<'_>, len: u64) -> Type
Get string type
Sourcepub fn get_typed_slice(context: &mut Context<'_>, item_ty: Type) -> Type
pub fn get_typed_slice(context: &mut Context<'_>, item_ty: Type) -> Type
Get typed slice type
Sourcepub fn as_string(&self, context: &Context<'_>) -> String
pub fn as_string(&self, context: &Context<'_>) -> String
Return a string representation of type, used for printing.
Sourcepub fn eq(&self, context: &Context<'_>, other: &Type) -> bool
pub fn eq(&self, context: &Context<'_>, other: &Type) -> bool
Compare a type to this one for equivalence.
PartialEq
does not take into account the special case for Unions below.
Sourcepub fn is_uint_of(&self, context: &Context<'_>, width: u16) -> bool
pub fn is_uint_of(&self, context: &Context<'_>, width: u16) -> bool
Is unsigned integer type of specific width
Sourcepub fn is_string_slice(&self, context: &Context<'_>) -> bool
pub fn is_string_slice(&self, context: &Context<'_>) -> bool
Is string type
Sourcepub fn is_string_array(&self, context: &Context<'_>) -> bool
pub fn is_string_array(&self, context: &Context<'_>) -> bool
Is string type
Sourcepub fn is_aggregate(&self, context: &Context<'_>) -> bool
pub fn is_aggregate(&self, context: &Context<'_>) -> bool
Is aggregate type: struct, union, enum or array.
Sourcepub fn get_pointee_type(&self, context: &Context<'_>) -> Option<Type>
pub fn get_pointee_type(&self, context: &Context<'_>) -> Option<Type>
Get pointed to type iff `self`` is a pointer.
Sourcepub fn get_uint_width(&self, context: &Context<'_>) -> Option<u16>
pub fn get_uint_width(&self, context: &Context<'_>) -> Option<u16>
Get width of an integer type.
Sourcepub fn get_indexed_type(
&self,
context: &Context<'_>,
indices: &[u64],
) -> Option<Type>
pub fn get_indexed_type( &self, context: &Context<'_>, indices: &[u64], ) -> Option<Type>
What’s the type of the struct/array value indexed by indices.
Sourcepub fn get_indexed_offset(
&self,
context: &Context<'_>,
indices: &[u64],
) -> Option<u64>
pub fn get_indexed_offset( &self, context: &Context<'_>, indices: &[u64], ) -> Option<u64>
What’s the offset, in bytes, of the indexed element?
Returns None
on invalid indices.
Panics if self
is not an aggregate (struct, union, or array).
Sourcepub fn get_value_indexed_offset(
&self,
context: &Context<'_>,
indices: &[Value],
) -> Option<u64>
pub fn get_value_indexed_offset( &self, context: &Context<'_>, indices: &[Value], ) -> Option<u64>
What’s the offset, in bytes, of the value indexed element? It may not always be possible to determine statically.
pub fn get_field_type(&self, context: &Context<'_>, idx: u64) -> Option<Type>
Sourcepub fn get_array_elem_type(&self, context: &Context<'_>) -> Option<Type>
pub fn get_array_elem_type(&self, context: &Context<'_>) -> Option<Type>
Get the type of the array element, if applicable.
Sourcepub fn get_typed_slice_elem_type(&self, context: &Context<'_>) -> Option<Type>
pub fn get_typed_slice_elem_type(&self, context: &Context<'_>) -> Option<Type>
Get the type of the array element, if applicable.
Sourcepub fn get_array_len(&self, context: &Context<'_>) -> Option<u64>
pub fn get_array_len(&self, context: &Context<'_>) -> Option<u64>
Get the length of the array , if applicable.
Sourcepub fn get_string_len(&self, context: &Context<'_>) -> Option<u64>
pub fn get_string_len(&self, context: &Context<'_>) -> Option<u64>
Get the length of a string.
Sourcepub fn get_field_types(&self, context: &Context<'_>) -> Vec<Type>
pub fn get_field_types(&self, context: &Context<'_>) -> Vec<Type>
Get the type of each field of a struct Type. Empty vector otherwise.
Sourcepub fn get_struct_field_offset_and_type(
&self,
context: &Context<'_>,
field_idx: u64,
) -> Option<(u64, Type)>
pub fn get_struct_field_offset_and_type( &self, context: &Context<'_>, field_idx: u64, ) -> Option<(u64, Type)>
Get the offset, in bytes, and the Type of the struct field at the index field_idx
, if self
is a struct,
otherwise None
.
Panics if the field_idx
is out of bounds.
Trait Implementations§
Source§impl DebugWithContext for Type
impl DebugWithContext for Type
fn fmt_with_context( &self, formatter: &mut Formatter<'_>, context: &Context<'_>, ) -> Result
fn with_context<'a, 'c, 'eng>( &'a self, context: &'c Context<'eng>, ) -> WithContext<'a, 'c, 'eng, Self>
impl Copy for Type
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> StorageAsMut for T
impl<T> StorageAsMut for T
fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where
Type: Mappable,
fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>where
Type: Mappable,
Source§impl<T> StorageAsRef for T
impl<T> StorageAsRef for T
fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where
Type: Mappable,
fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>where
Type: Mappable,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.