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>
where Id: PartialEq,

source

pub fn new(typ: Type<Id, ArcType<Id>>) -> ArcType<Id>

source§

impl<Id> ArcType<Id>

source

pub fn set(into: &mut Self, typ: Type<Id, Self>)
where Id: Clone + PartialEq,

source

pub fn level(&self) -> u32

Returns the lowest level which this type contains. The level informs from where type variables where created.

source

pub fn needs_generalize(&self) -> bool
where Id: PartialEq,

source

pub fn forall_params(&self) -> impl Iterator<Item = &Generic<Id>>

Methods from Deref<Target = Type<Id, ArcType<Id>>>§

source

pub fn as_variable(&self) -> Option<&TypeVariable>

source

pub fn is_array(&self) -> bool

source

pub fn as_function(&self) -> Option<(&T, &T)>

source

pub fn as_explicit_function(&self) -> Option<(&T, &T)>

source

pub fn as_function_with_type(&self) -> Option<(ArgType, &T, &T)>

source

pub fn unapplied_args(&self) -> Cow<'_, [T]>
where T: Clone,

source

pub fn alias_ident(&self) -> Option<&Id>

source

pub fn applied_alias(&self) -> Option<&AliasRef<Id, T>>

source

pub fn is_non_polymorphic_record(&self) -> bool

source

pub fn params(&self) -> &[Generic<Id>]

source

pub fn kind<'k>(&'k self, cache: &'k KindCache) -> Cow<'k, ArcKind>

source

pub fn name(&self) -> Option<&SymbolRef>

Returns the name of self Example: Option a => Option Int => Int

source

pub fn owned_name(&self) -> Option<SymbolKey>

Trait Implementations§

source§

impl<'ast, Id> AstClone<'ast, Id> for ArcType<Id>

source§

fn ast_clone(&self, _arena: ArenaRef<'_, 'ast, Id>) -> Self

source§

impl<Id> Borrow<Type<Id>> for ArcType<Id>

source§

fn borrow(&self) -> &Type<Id, ArcType<Id>>

Immutably borrows from an owned value. Read more
source§

impl<Id> Clone for ArcType<Id>

source§

fn clone(&self) -> ArcType<Id>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Id: Debug> Debug for ArcType<Id>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Id> Default for ArcType<Id>
where Id: PartialEq,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<Id> Deref for ArcType<Id>

§

type Target = Type<Id>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Type<Id, ArcType<Id>>

Dereferences the value.
source§

impl<'de, Id> DeserializeState<'de, Seed<Id, ArcType<Id>>> for ArcType<Id>
where Id: DeserializeState<'de, Seed<Id, ArcType<Id>>> + Clone + Any + PartialEq,

source§

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: AsRef<str> + AsId<Id>> Display for ArcType<Id>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Id> From<(Type<Id>, Flags)> for ArcType<Id>

source§

fn from((typ, flags): (Type<Id, ArcType<Id>>, Flags)) -> ArcType<Id>

Converts to this type from the input type.
source§

impl<Id> From<Type<Id>> for ArcType<Id>
where Id: PartialEq,

source§

fn from(typ: Type<Id, ArcType<Id>>) -> ArcType<Id>

Converts to this type from the input type.
source§

impl<Id> HasMetadata for ArcType<Id>

source§

impl<Id> HasSpan for ArcType<Id>

source§

fn span(&self) -> Span<BytePos>

source§

impl<Id: Hash> Hash for ArcType<Id>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<Id: PartialEq> PartialEq for ArcType<Id>

source§

fn eq(&self, other: &ArcType<Id>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Id> Pointer for ArcType<Id>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

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,

Serializes self
source§

impl<Id> Shared for ArcType<Id>
where Id: PartialEq,

source§

fn unique(&self) -> bool

source§

fn as_ptr(&self) -> *const ()

source§

impl<'a, I, A> ToDoc<'a, Arena<'a, A>, A, &'a dyn Source> for ArcType<I>
where I: AsRef<str> + AsId<I>, A: Clone,

source§

fn to_doc( &'a self, arena: &'a Arena<'a, A>, source: &'a dyn Source ) -> DocBuilder<'a, Arena<'a, A>, A>

source§

impl<'a, I, A> ToDoc<'a, Arena<'a, A>, A, ()> for ArcType<I>
where I: AsRef<str> + AsId<I>, A: Clone,

source§

fn to_doc( &'a self, arena: &'a Arena<'a, A>, _: () ) -> DocBuilder<'a, Arena<'a, A>, A>

source§

impl TypeContextAlloc for ArcType

source§

fn alloc(into: &mut Self, typ: Type<Symbol, Self>, flags: Flags)

source§

impl<Id> TypeExt for ArcType<Id>

source§

fn strong_count(typ: &ArcType<Id>) -> usize

source§

fn type_field_iter(&self) -> TypeFieldIterator<'_, Self>

Returns an iterator over all type fields in a record. { Test, Test2, x, y } => [Test, Test2]
source§

fn arg_iter(&self) -> ArgIterator<'_, Self>

source§

fn implicit_arg_iter(&self) -> ImplicitArgIterator<'_, Self>

source§

fn row_iter(&self) -> RowIterator<'_, Self>

Returns an iterator over all fields in a record. { Test, Test2, x, y } => [x, y]
source§

fn remove_implicit_args<'a>(&'a self) -> &'a Self

source§

fn remove_forall<'a>(&'a self) -> &'a Self

source§

fn remove_forall_and_implicit_args<'a>(&'a self) -> &'a Self

source§

fn forall_scope_iter(&self) -> ForallScopeIter<'_, Self>

source§

impl<Id> TypePtr for ArcType<Id>

§

type Id = Id

§

type SpannedId = Id

§

type Types = SmallVec<[ArcType<Id>; 2]>

§

type Generics = Vec<Generic<Id>>

§

type Fields = Vec<Field<Id>>

§

type TypeFields = Vec<Field<Id, Alias<Id, ArcType<Id>>>>

source§

fn flags(&self) -> Flags

source§

fn spine(&self) -> &Self

source§

impl<Id: Eq> Eq for ArcType<Id>

source§

impl<Id> StructuralEq for ArcType<Id>

source§

impl<Id> StructuralPartialEq for ArcType<Id>

Auto Trait Implementations§

§

impl<Id> RefUnwindSafe for ArcType<Id>
where Id: RefUnwindSafe,

§

impl<Id> Send for ArcType<Id>
where Id: Send + Sync,

§

impl<Id> Sync for ArcType<Id>
where Id: Send + Sync,

§

impl<Id> Unpin for ArcType<Id>

§

impl<Id> UnwindSafe for ArcType<Id>
where Id: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<Id> AsId<Id> for Id
where Id: ?Sized,

source§

fn as_id(&self) -> &Id

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for T
where T: Hash + ?Sized,

§

fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Any for T
where T: Any,

§

impl<T> CloneAny for T
where T: Any + Clone,