Struct gluon_base::types::ArcType
source · pub struct ArcType<Id = Symbol> { /* private fields */ }
Expand description
A shared type which is atomically reference counted
Implementations§
source§impl<Id> ArcType<Id>
impl<Id> ArcType<Id>
pub fn set(into: &mut Self, typ: Type<Id, Self>)
sourcepub fn level(&self) -> u32
pub fn level(&self) -> u32
Returns the lowest level which this type contains. The level informs from where type variables where created.
pub fn needs_generalize(&self) -> boolwhere
Id: PartialEq,
pub fn forall_params(&self) -> impl Iterator<Item = &Generic<Id>>
Methods from Deref<Target = Type<Id, ArcType<Id>>>§
pub fn as_variable(&self) -> Option<&TypeVariable>
pub fn is_array(&self) -> bool
pub fn as_function(&self) -> Option<(&T, &T)>
pub fn as_explicit_function(&self) -> Option<(&T, &T)>
pub fn as_function_with_type(&self) -> Option<(ArgType, &T, &T)>
pub fn unapplied_args(&self) -> Cow<'_, [T]>where
T: Clone,
pub fn alias_ident(&self) -> Option<&Id>
pub fn applied_alias(&self) -> Option<&AliasRef<Id, T>>
pub fn is_non_polymorphic_record(&self) -> bool
pub fn params(&self) -> &[Generic<Id>]
pub fn kind<'k>(&'k self, cache: &'k KindCache) -> Cow<'k, ArcKind>
sourcepub fn name(&self) -> Option<&SymbolRef>
pub fn name(&self) -> Option<&SymbolRef>
Returns the name of self
Example:
Option a => Option
Int => Int
pub fn owned_name(&self) -> Option<SymbolKey>
Trait Implementations§
source§impl<'de, Id> DeserializeState<'de, Seed<Id, ArcType<Id>>> for ArcType<Id>
impl<'de, Id> DeserializeState<'de, Seed<Id, ArcType<Id>>> for ArcType<Id>
source§fn deserialize_state<D>(
seed: &mut Seed<Id, ArcType<Id>>,
deserializer: D
) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize_state<D>(
seed: &mut Seed<Id, ArcType<Id>>,
deserializer: D
) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserializes
Self
using seed
and the deserializer
source§impl<Id> HasMetadata for ArcType<Id>
impl<Id> HasMetadata for ArcType<Id>
source§impl<Id: PartialEq> PartialEq for ArcType<Id>
impl<Id: PartialEq> PartialEq for ArcType<Id>
source§impl<Id> SerializeState<SeSeed> for ArcType<Id>
impl<Id> SerializeState<SeSeed> for ArcType<Id>
source§fn serialize_state<S>(
&self,
serializer: S,
seed: &SeSeed
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_state<S>(
&self,
serializer: S,
seed: &SeSeed
) -> Result<S::Ok, S::Error>where
S: Serializer,
Serializes
self
source§impl TypeContextAlloc for ArcType
impl TypeContextAlloc for ArcType
source§impl<Id> TypeExt for ArcType<Id>
impl<Id> TypeExt for ArcType<Id>
fn strong_count(typ: &ArcType<Id>) -> usize
source§fn type_field_iter(&self) -> TypeFieldIterator<'_, Self> ⓘ
fn type_field_iter(&self) -> TypeFieldIterator<'_, Self> ⓘ
Returns an iterator over all type fields in a record.
{ Test, Test2, x, y } => [Test, Test2]
fn arg_iter(&self) -> ArgIterator<'_, Self> ⓘ
fn implicit_arg_iter(&self) -> ImplicitArgIterator<'_, Self> ⓘ
source§fn row_iter(&self) -> RowIterator<'_, Self> ⓘ
fn row_iter(&self) -> RowIterator<'_, Self> ⓘ
Returns an iterator over all fields in a record.
{ Test, Test2, x, y } => [x, y]
fn remove_implicit_args<'a>(&'a self) -> &'a Self
fn remove_forall<'a>(&'a self) -> &'a Self
fn remove_forall_and_implicit_args<'a>(&'a self) -> &'a Self
fn forall_scope_iter(&self) -> ForallScopeIter<'_, Self> ⓘ
impl<Id: Eq> Eq for ArcType<Id>
impl<Id> StructuralEq for ArcType<Id>
impl<Id> StructuralPartialEq for ArcType<Id>
Auto Trait Implementations§
impl<Id> RefUnwindSafe for ArcType<Id>where
Id: RefUnwindSafe,
impl<Id> Send for ArcType<Id>
impl<Id> Sync for ArcType<Id>
impl<Id> Unpin for ArcType<Id>
impl<Id> UnwindSafe for ArcType<Id>where
Id: RefUnwindSafe,
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