pub struct Ty<'gcx>(/* private fields */);Expand description
An interned type.
Implementations§
Source§impl<'gcx> Ty<'gcx>
impl<'gcx> Ty<'gcx>
pub fn new(gcx: Gcx<'gcx>, kind: TyKind<'gcx>) -> Ty<'gcx>
pub fn with_loc(self, gcx: Gcx<'gcx>, loc: DataLocation) -> Ty<'gcx>
pub fn as_externally_callable_function(self, gcx: Gcx<'gcx>) -> Ty<'gcx>
pub fn make_ref(self, gcx: Gcx<'gcx>, loc: DataLocation) -> Ty<'gcx>
pub fn make_type_type(self, gcx: Gcx<'gcx>) -> Ty<'gcx>
pub fn make_meta(self, gcx: Gcx<'gcx>) -> Ty<'gcx>
Sourcepub fn is_ref_at(self, loc: DataLocation) -> bool
pub fn is_ref_at(self, loc: DataLocation) -> bool
Returns true if the type is a reference to the given location.
Sourcepub fn is_value_type(self) -> bool
pub fn is_value_type(self) -> bool
Returns true if the type is a value type.
Reference: https://docs.soliditylang.org/en/latest/types.html#value-types
Sourcepub fn is_reference_type(self) -> bool
pub fn is_reference_type(self) -> bool
Returns true if the type is a reference type.
Sourcepub fn is_recursive(self) -> bool
pub fn is_recursive(self) -> bool
Returns true if the type is recursive.
Sourcepub fn has_mapping(self) -> bool
pub fn has_mapping(self) -> bool
Returns true if this type contains a mapping.
Sourcepub fn has_error(self) -> Result<(), ErrorGuaranteed>
pub fn has_error(self) -> Result<(), ErrorGuaranteed>
Returns true if this type contains an error.
Sourcepub fn can_be_exported(self) -> bool
pub fn can_be_exported(self) -> bool
Returns true if this type can be part of an externally callable function.
Sourcepub fn parameters(self) -> Option<&'gcx [Ty<'gcx>]>
pub fn parameters(self) -> Option<&'gcx [Ty<'gcx>]>
Returns the parameter types of the type.
Sourcepub fn state_mutability(self) -> Option<StateMutability>
pub fn state_mutability(self) -> Option<StateMutability>
Returns the state mutability of the type.
Sourcepub fn visibility(self) -> Option<Visibility>
pub fn visibility(self) -> Option<Visibility>
Returns the visibility of the type.
Sourcepub fn visit<T>(
self,
f: &mut impl FnMut(Ty<'gcx>) -> ControlFlow<T>,
) -> ControlFlow<T>
pub fn visit<T>( self, f: &mut impl FnMut(Ty<'gcx>) -> ControlFlow<T>, ) -> ControlFlow<T>
Visits the type and its subtypes.
Trait Implementations§
impl<'gcx> Copy for Ty<'gcx>
impl<'gcx> Eq for Ty<'gcx>
impl<'gcx> StructuralPartialEq for Ty<'gcx>
Auto Trait Implementations§
impl<'gcx> Freeze for Ty<'gcx>
impl<'gcx> RefUnwindSafe for Ty<'gcx>
impl<'gcx> Send for Ty<'gcx>
impl<'gcx> Sync for Ty<'gcx>
impl<'gcx> Unpin for Ty<'gcx>
impl<'gcx> UnwindSafe for Ty<'gcx>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> 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
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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> ⓘ
Converts
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> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more