pub struct Type(pub Index);
Tuple Fields§
§0: Index
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_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 new_string(context: &mut Context, len: u64) -> Type
pub fn new_string(context: &mut Context, len: u64) -> Type
Get string 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: u8) -> bool
pub fn is_uint_of(&self, context: &Context, width: u8) -> bool
Is unsigned integer type of specific width
sourcepub fn get_uint_width(&self, context: &Context) -> Option<u8>
pub fn get_uint_width(&self, context: &Context) -> Option<u8>
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 value indexed by indices.
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_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.
Trait Implementations§
source§impl DebugWithContext for Type
impl DebugWithContext for Type
fn fmt_with_context<'a, 'c>( &'a self, formatter: &mut Formatter<'_>, context: &'c Context ) -> Result
fn with_context<'a, 'c>( &'a self, context: &'c Context ) -> WithContext<'a, 'c, Self>
source§impl PartialEq<Type> for Type
impl PartialEq<Type> for Type
impl Copy for Type
impl Eq for Type
impl StructuralEq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
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 + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more