Enum cairo_lang_semantic::types::TypeLongId
source · pub enum TypeLongId {
Concrete(ConcreteTypeId),
Tuple(Vec<TypeId>),
Snapshot(TypeId),
GenericParameter(GenericParamId),
Var(TypeVar),
Coupon(FunctionId),
FixedSizeArray {
type_id: TypeId,
size: ConstValueId,
},
ImplType(ImplTypeId),
TraitType(TraitTypeId),
Missing(DiagnosticAdded),
}
Variants§
Concrete(ConcreteTypeId)
Tuple(Vec<TypeId>)
Some expressions might have invalid types during processing, either due to errors or during inference.
Snapshot(TypeId)
GenericParameter(GenericParamId)
Var(TypeVar)
Coupon(FunctionId)
FixedSizeArray
ImplType(ImplTypeId)
TraitType(TraitTypeId)
Missing(DiagnosticAdded)
Implementations§
source§impl TypeLongId
impl TypeLongId
pub fn format(&self, db: &dyn SemanticGroup) -> String
sourcepub fn head(&self, db: &dyn SemanticGroup) -> Option<TypeHead>
pub fn head(&self, db: &dyn SemanticGroup) -> Option<TypeHead>
Returns the TypeHead for a type if available.
sourcepub fn is_phantom(&self, db: &dyn SemanticGroup) -> bool
pub fn is_phantom(&self, db: &dyn SemanticGroup) -> bool
Returns whether the type is phantom.
Type is considered phantom if it has the #[phantom]
attribute, or is a tuple or fixed
sized array containing it.
Trait Implementations§
source§impl Clone for TypeLongId
impl Clone for TypeLongId
source§fn clone(&self) -> TypeLongId
fn clone(&self) -> TypeLongId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TypeLongId
impl Debug for TypeLongId
source§impl DebugWithDb<dyn SemanticGroup> for TypeLongId
impl DebugWithDb<dyn SemanticGroup> for TypeLongId
source§impl Hash for TypeLongId
impl Hash for TypeLongId
source§impl<'a> Intern<'a, dyn SemanticGroup + 'a, TypeId> for TypeLongId
impl<'a> Intern<'a, dyn SemanticGroup + 'a, TypeId> for TypeLongId
source§impl<'a> LookupIntern<'a, dyn SemanticGroup + 'a, TypeLongId> for TypeId
impl<'a> LookupIntern<'a, dyn SemanticGroup + 'a, TypeLongId> for TypeId
fn lookup_intern( &self, db: &(impl Upcast<dyn SemanticGroup + 'a> + ?Sized) ) -> TypeLongId
source§impl OptionFrom<TypeLongId> for ConcreteTypeId
impl OptionFrom<TypeLongId> for ConcreteTypeId
fn option_from(other: TypeLongId) -> Option<Self>
source§impl PartialEq for TypeLongId
impl PartialEq for TypeLongId
source§fn eq(&self, other: &TypeLongId) -> bool
fn eq(&self, other: &TypeLongId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: SemanticRewriter<ConcreteTypeId, Error> + SemanticRewriter<Vec<TypeId>, Error> + SemanticRewriter<TypeId, Error> + SemanticRewriter<GenericParamId, Error> + SemanticRewriter<TypeVar, Error> + SemanticRewriter<FunctionId, Error> + SemanticRewriter<ConstValueId, Error> + SemanticRewriter<ImplTypeId, Error> + SemanticRewriter<TraitTypeId, Error>, Error> SemanticObject<T, Error> for TypeLongId
impl<T: SemanticRewriter<ConcreteTypeId, Error> + SemanticRewriter<Vec<TypeId>, Error> + SemanticRewriter<TypeId, Error> + SemanticRewriter<GenericParamId, Error> + SemanticRewriter<TypeVar, Error> + SemanticRewriter<FunctionId, Error> + SemanticRewriter<ConstValueId, Error> + SemanticRewriter<ImplTypeId, Error> + SemanticRewriter<TraitTypeId, Error>, Error> SemanticObject<T, Error> for TypeLongId
fn default_rewrite(&mut self, rewriter: &mut T) -> Result<RewriteResult, Error>
source§impl<'a> SemanticRewriter<TypeLongId, DiagnosticAdded> for SubstitutionRewriter<'a>
impl<'a> SemanticRewriter<TypeLongId, DiagnosticAdded> for SubstitutionRewriter<'a>
fn internal_rewrite(&mut self, value: &mut TypeLongId) -> Maybe<RewriteResult>
fn rewrite(&mut self, value: T) -> Result<T, Error>
source§impl<'a> SemanticRewriter<TypeLongId, NoError> for Inference<'a>
impl<'a> SemanticRewriter<TypeLongId, NoError> for Inference<'a>
fn internal_rewrite( &mut self, value: &mut TypeLongId ) -> Result<RewriteResult, NoError>
fn rewrite(&mut self, value: T) -> Result<T, Error>
impl Eq for TypeLongId
impl StructuralPartialEq for TypeLongId
Auto Trait Implementations§
impl Freeze for TypeLongId
impl RefUnwindSafe for TypeLongId
impl Send for TypeLongId
impl Sync for TypeLongId
impl Unpin for TypeLongId
impl UnwindSafe for TypeLongId
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<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
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<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