pub struct TypeId(/* private fields */);
Implementations§
Source§impl TypeId
impl TypeId
pub fn unit(db: &dyn AnalyzerDb) -> Self
pub fn bool(db: &dyn AnalyzerDb) -> Self
pub fn int(db: &dyn AnalyzerDb, int: Integer) -> Self
pub fn address(db: &dyn AnalyzerDb) -> Self
pub fn base(db: &dyn AnalyzerDb, t: Base) -> Self
pub fn tuple(db: &dyn AnalyzerDb, items: &[TypeId]) -> Self
pub fn typ(&self, db: &dyn AnalyzerDb) -> Type
pub fn deref_typ(&self, db: &dyn AnalyzerDb) -> Type
pub fn deref(self, db: &dyn AnalyzerDb) -> TypeId
pub fn make_sptr(self, db: &dyn AnalyzerDb) -> TypeId
pub fn has_fixed_size(&self, db: &dyn AnalyzerDb) -> bool
Sourcepub fn is_primitive(&self, db: &dyn AnalyzerDb) -> bool
pub fn is_primitive(&self, db: &dyn AnalyzerDb) -> bool
true
if Type::Base or Type::Contract (which is just an Address)
pub fn is_bool(&self, db: &dyn AnalyzerDb) -> bool
pub fn is_contract(&self, db: &dyn AnalyzerDb) -> bool
pub fn is_integer(&self, db: &dyn AnalyzerDb) -> bool
pub fn is_map(&self, db: &dyn AnalyzerDb) -> bool
pub fn is_string(&self, db: &dyn AnalyzerDb) -> bool
pub fn is_self_ty(&self, db: &dyn AnalyzerDb) -> bool
pub fn as_struct(&self, db: &dyn AnalyzerDb) -> Option<StructId>
pub fn as_trait_or_type(&self) -> TraitOrType
pub fn is_struct(&self, db: &dyn AnalyzerDb) -> bool
pub fn is_sptr(&self, db: &dyn AnalyzerDb) -> bool
pub fn is_generic(&self, db: &dyn AnalyzerDb) -> bool
pub fn is_mut(&self, db: &dyn AnalyzerDb) -> bool
pub fn name(&self, db: &dyn AnalyzerDb) -> SmolStr
pub fn kind_display_name(&self, db: &dyn AnalyzerDb) -> &str
Sourcepub fn get_impl_for(
&self,
db: &dyn AnalyzerDb,
trait_: TraitId,
) -> Option<ImplId>
pub fn get_impl_for( &self, db: &dyn AnalyzerDb, trait_: TraitId, ) -> Option<ImplId>
Return the impl
for the given trait. There can only ever be a single
implementation per concrete type and trait.
Sourcepub fn trait_function_candidates(
&self,
context: &mut dyn AnalyzerContext,
fn_name: &str,
) -> (Vec<(FunctionId, ImplId)>, Vec<(FunctionId, ImplId)>)
pub fn trait_function_candidates( &self, context: &mut dyn AnalyzerContext, fn_name: &str, ) -> (Vec<(FunctionId, ImplId)>, Vec<(FunctionId, ImplId)>)
Looks up all possible candidates of the given function name that are implemented via traits. Groups results in two lists, the first contains all theoretical possible candidates and the second contains only those that are actually callable because the trait is in scope.
Sourcepub fn function_sig(
&self,
db: &dyn AnalyzerDb,
name: &str,
) -> Option<FunctionSigId>
pub fn function_sig( &self, db: &dyn AnalyzerDb, name: &str, ) -> Option<FunctionSigId>
Signature for the function with the given name defined directly on the type. Does not consider trait impls.
Sourcepub fn function_sigs(
&self,
db: &dyn AnalyzerDb,
name: &str,
) -> Rc<[FunctionSigId]>
pub fn function_sigs( &self, db: &dyn AnalyzerDb, name: &str, ) -> Rc<[FunctionSigId]>
Like function_sig
but returns a Vec<FunctionSigId>
which not only
considers functions natively implemented on the type but also those
that are provided by implemented traits on the type.
pub fn self_function( &self, db: &dyn AnalyzerDb, name: &str, ) -> Option<FunctionSigId>
Sourcepub fn is_emittable(self, db: &dyn AnalyzerDb) -> bool
pub fn is_emittable(self, db: &dyn AnalyzerDb) -> bool
Returns true
if the type qualifies to implement the Emittable
trait
TODO: This function should be removed when we add Encode / Decode
trait
Sourcepub fn is_encodable(self, db: &dyn AnalyzerDb) -> Result<bool, TypeError>
pub fn is_encodable(self, db: &dyn AnalyzerDb) -> Result<bool, TypeError>
Returns true
if the type is encodable in Solidity ABI.
TODO: This function must be removed when we add Encode
/Decode
trait.
Trait Implementations§
Source§impl DisplayWithDb for TypeId
impl DisplayWithDb for TypeId
Source§impl InternKey for TypeId
impl InternKey for TypeId
Source§fn from_intern_id(v: InternId) -> Self
fn from_intern_id(v: InternId) -> Self
u32
value.Source§fn as_intern_id(&self) -> InternId
fn as_intern_id(&self) -> InternId
u32
with which the intern-key was created.Source§impl Ord for TypeId
impl Ord for TypeId
Source§impl PartialOrd for TypeId
impl PartialOrd for TypeId
Source§impl TypeDowncast for TypeId
impl TypeDowncast for TypeId
fn as_array(&self, db: &dyn AnalyzerDb) -> Option<Array>
fn as_tuple(&self, db: &dyn AnalyzerDb) -> Option<Tuple>
fn as_string(&self, db: &dyn AnalyzerDb) -> Option<FeString>
fn as_map(&self, db: &dyn AnalyzerDb) -> Option<Map>
fn as_int(&self, db: &dyn AnalyzerDb) -> Option<Integer>
impl Copy for TypeId
impl Eq for TypeId
impl StructuralPartialEq for TypeId
Auto Trait Implementations§
impl Freeze for TypeId
impl RefUnwindSafe for TypeId
impl Send for TypeId
impl Sync for TypeId
impl Unpin for TypeId
impl UnwindSafe for TypeId
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
Source§impl<T> Displayable for Twhere
T: DisplayWithDb,
impl<T> Displayable for Twhere
T: DisplayWithDb,
fn display<'a, 'b>( &'a self, db: &'b dyn AnalyzerDb, ) -> DisplayableWrapper<'b, &'a Self>
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.§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.