Struct gluon_base::types::TypeCache
source · pub struct TypeCache<Id, T>{Show 13 fields
pub kind_cache: KindCache,
pub hole: T,
pub opaque: T,
pub error: T,
pub int: T,
pub byte: T,
pub float: T,
pub string: T,
pub char: T,
pub function_builtin: T,
pub array_builtin: T,
pub unit: T,
pub empty_row: T,
/* private fields */
}
Fields§
§kind_cache: KindCache
§hole: T
§opaque: T
§error: T
§int: T
§byte: T
§float: T
§string: T
§char: T
§function_builtin: T
§array_builtin: T
§unit: T
§empty_row: T
Implementations§
source§impl<Id, T> TypeCache<Id, T>
impl<Id, T> TypeCache<Id, T>
pub fn hole(&self) -> T
pub fn opaque(&self) -> T
pub fn error(&self) -> T
pub fn int(&self) -> T
pub fn byte(&self) -> T
pub fn float(&self) -> T
pub fn string(&self) -> T
pub fn char(&self) -> T
pub fn function_builtin(&self) -> T
pub fn array_builtin(&self) -> T
pub fn unit(&self) -> T
pub fn empty_row(&self) -> T
source§impl<Id, T> TypeCache<Id, T>
impl<Id, T> TypeCache<Id, T>
pub fn function<I>(&self, args: I, ret: T) -> T
pub fn function_implicit<I>(&self, args: I, ret: T) -> T
pub fn tuple<S, I>(&self, symbols: &mut S, elems: I) -> T
pub fn variant(&self, fields: Vec<Field<T::SpannedId, T>>) -> T
pub fn poly_variant(&self, fields: Vec<Field<T::SpannedId, T>>, rest: T) -> T
pub fn record( &self, types: Vec<Field<T::SpannedId, Alias<Id, T>>>, fields: Vec<Field<T::SpannedId, T>> ) -> T
pub fn effect(&self, fields: Vec<Field<T::SpannedId, T>>) -> T
pub fn poly_effect(&self, fields: Vec<Field<T::SpannedId, T>>, rest: T) -> T
pub fn array(&self, typ: T) -> T
source§impl<Id, T> TypeCache<Id, T>
impl<Id, T> TypeCache<Id, T>
pub fn builtin_type(&self, typ: BuiltinType) -> T
Trait Implementations§
source§impl<'a, Id, T> TypeContext<Id, T> for &'a TypeCache<Id, T>where
T: TypeExt<Id = Id> + From<(Type<Id, T>, Flags)> + From<Type<Id, T>> + Clone,
T::Types: Default + Extend<T> + FromIterator<T>,
T::Generics: FromIterator<Generic<Id>>,
T::Fields: FromIterator<Field<T::SpannedId, T>>,
T::TypeFields: FromIterator<Field<T::SpannedId, Alias<Id, T>>>,
impl<'a, Id, T> TypeContext<Id, T> for &'a TypeCache<Id, T>where
T: TypeExt<Id = Id> + From<(Type<Id, T>, Flags)> + From<Type<Id, T>> + Clone,
T::Types: Default + Extend<T> + FromIterator<T>,
T::Generics: FromIterator<Generic<Id>>,
T::Fields: FromIterator<Field<T::SpannedId, T>>,
T::TypeFields: FromIterator<Field<T::SpannedId, Alias<Id, T>>>,
fn intern(&mut self, typ: Type<Id, T>) -> T
fn intern_types(&mut self, types: impl IntoIterator<Item = T>) -> T::Types
fn intern_generics( &mut self, types: impl IntoIterator<Item = Generic<Id>> ) -> T::Generics
fn intern_fields( &mut self, types: impl IntoIterator<Item = Field<T::SpannedId, T>> ) -> T::Fields
fn intern_type_fields( &mut self, types: impl IntoIterator<Item = Field<T::SpannedId, Alias<Id, T>>> ) -> T::TypeFields
fn intern_flags(&mut self, typ: Type<Id, T>, flags: Flags) -> T
fn hole(&mut self) -> T
fn opaque(&mut self) -> T
fn error(&mut self) -> T
fn int(&mut self) -> T
fn byte(&mut self) -> T
fn float(&mut self) -> T
fn string(&mut self) -> T
fn char(&mut self) -> T
fn function_builtin(&mut self) -> T
fn array_builtin(&mut self) -> T
fn unit(&mut self) -> T
fn empty_row(&mut self) -> T
fn builtin(&mut self, typ: BuiltinType) -> T
fn forall(&mut self, params: T::Generics, typ: T) -> T
fn array(&mut self, typ: T) -> T
fn app(&mut self, id: T, args: T::Types) -> T
fn variant(&mut self, fields: T::Fields) -> T
fn poly_variant(&mut self, fields: T::Fields, rest: T) -> T
fn effect(&mut self, fields: T::Fields) -> T
fn poly_effect(&mut self, fields: T::Fields, rest: T) -> T
fn record(&mut self, types: T::TypeFields, fields: T::Fields) -> T
fn poly_record(&mut self, types: T::TypeFields, fields: T::Fields, rest: T) -> T
fn extend_full_row( &mut self, types: T::TypeFields, fields: T::Fields, rest: T ) -> T
fn extend_row(&mut self, fields: T::Fields, rest: T) -> T
fn extend_type_row(&mut self, types: T::TypeFields, rest: T) -> T
fn function<I>(&mut self, args: I, ret: T) -> T
fn function_implicit<I>(&mut self, args: I, ret: T) -> T
fn function_type<I>(&mut self, arg_type: ArgType, args: I, ret: T) -> T
fn generic(&mut self, typ: Generic<Id>) -> T
fn skolem(&mut self, typ: Skolem<Id>) -> T
fn variable(&mut self, typ: TypeVariable) -> T
fn alias(&mut self, name: Id, args: T::Generics, typ: T) -> T
fn ident(&mut self, id: KindedIdent<Id>) -> T
fn projection(&mut self, id: AppVec<Id>) -> T
fn builtin_type(&mut self, typ: BuiltinType) -> T
fn new_alias(&mut self, name: Id, args: T::Generics, typ: T) -> Alias<Id, T>
fn new_data_alias(&mut self, data: AliasData<Id, T>) -> Alias<Id, T>
source§impl<Id, T> TypeContext<Id, T> for TypeCache<Id, T>where
T: TypeExt<Id = Id> + From<(Type<Id, T>, Flags)> + From<Type<Id, T>> + Clone,
T::Types: Default + Extend<T> + FromIterator<T>,
T::Generics: FromIterator<Generic<Id>>,
T::Fields: FromIterator<Field<T::SpannedId, T>>,
T::TypeFields: FromIterator<Field<T::SpannedId, Alias<Id, T>>>,
impl<Id, T> TypeContext<Id, T> for TypeCache<Id, T>where
T: TypeExt<Id = Id> + From<(Type<Id, T>, Flags)> + From<Type<Id, T>> + Clone,
T::Types: Default + Extend<T> + FromIterator<T>,
T::Generics: FromIterator<Generic<Id>>,
T::Fields: FromIterator<Field<T::SpannedId, T>>,
T::TypeFields: FromIterator<Field<T::SpannedId, Alias<Id, T>>>,
fn intern(&mut self, typ: Type<Id, T>) -> T
fn intern_types(&mut self, types: impl IntoIterator<Item = T>) -> T::Types
fn intern_generics( &mut self, types: impl IntoIterator<Item = Generic<Id>> ) -> T::Generics
fn intern_fields( &mut self, types: impl IntoIterator<Item = Field<T::SpannedId, T>> ) -> T::Fields
fn intern_type_fields( &mut self, types: impl IntoIterator<Item = Field<T::SpannedId, Alias<Id, T>>> ) -> T::TypeFields
fn intern_flags(&mut self, typ: Type<Id, T>, flags: Flags) -> T
fn hole(&mut self) -> T
fn opaque(&mut self) -> T
fn error(&mut self) -> T
fn int(&mut self) -> T
fn byte(&mut self) -> T
fn float(&mut self) -> T
fn string(&mut self) -> T
fn char(&mut self) -> T
fn function_builtin(&mut self) -> T
fn array_builtin(&mut self) -> T
fn unit(&mut self) -> T
fn empty_row(&mut self) -> T
fn builtin(&mut self, typ: BuiltinType) -> T
fn forall(&mut self, params: T::Generics, typ: T) -> T
fn array(&mut self, typ: T) -> T
fn app(&mut self, id: T, args: T::Types) -> T
fn variant(&mut self, fields: T::Fields) -> T
fn poly_variant(&mut self, fields: T::Fields, rest: T) -> T
fn effect(&mut self, fields: T::Fields) -> T
fn poly_effect(&mut self, fields: T::Fields, rest: T) -> T
fn record(&mut self, types: T::TypeFields, fields: T::Fields) -> T
fn poly_record(&mut self, types: T::TypeFields, fields: T::Fields, rest: T) -> T
fn extend_full_row( &mut self, types: T::TypeFields, fields: T::Fields, rest: T ) -> T
fn extend_row(&mut self, fields: T::Fields, rest: T) -> T
fn extend_type_row(&mut self, types: T::TypeFields, rest: T) -> T
fn function<I>(&mut self, args: I, ret: T) -> T
fn function_implicit<I>(&mut self, args: I, ret: T) -> T
fn function_type<I>(&mut self, arg_type: ArgType, args: I, ret: T) -> T
fn generic(&mut self, typ: Generic<Id>) -> T
fn skolem(&mut self, typ: Skolem<Id>) -> T
fn variable(&mut self, typ: TypeVariable) -> T
fn alias(&mut self, name: Id, args: T::Generics, typ: T) -> T
fn ident(&mut self, id: KindedIdent<Id>) -> T
fn projection(&mut self, id: AppVec<Id>) -> T
fn builtin_type(&mut self, typ: BuiltinType) -> T
fn new_alias(&mut self, name: Id, args: T::Generics, typ: T) -> Alias<Id, T>
fn new_data_alias(&mut self, data: AliasData<Id, T>) -> Alias<Id, T>
Auto Trait Implementations§
impl<Id, T> RefUnwindSafe for TypeCache<Id, T>where
Id: RefUnwindSafe,
T: RefUnwindSafe,
impl<Id, T> Send for TypeCache<Id, T>
impl<Id, T> Sync for TypeCache<Id, T>
impl<Id, T> Unpin for TypeCache<Id, T>
impl<Id, T> UnwindSafe for TypeCache<Id, T>where
Id: UnwindSafe,
T: UnwindSafe,
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