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
sourceimpl<Id, T> TypeCache<Id, T>where
T: From<Type<Id, T>> + Clone,
impl<Id, T> TypeCache<Id, T>where
T: From<Type<Id, T>> + Clone,
pub fn new() -> Self
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
sourceimpl<Id, T> TypeCache<Id, T>where
T: From<Type<Id, T>> + Clone,
impl<Id, T> TypeCache<Id, T>where
T: From<Type<Id, T>> + Clone,
pub fn function<I>(&self, args: I, ret: T) -> Twhere
I: IntoIterator<Item = T>,
I::IntoIter: DoubleEndedIterator<Item = T>,
pub fn function_implicit<I>(&self, args: I, ret: T) -> Twhere
I: IntoIterator<Item = T>,
I::IntoIter: DoubleEndedIterator<Item = T>,
pub fn tuple<S, I>(&self, symbols: &mut S, elems: I) -> Twhere
S: ?Sized + IdentEnv<Ident = Id>,
I: IntoIterator<Item = T>,
pub fn variant(&self, fields: Vec<Field<Id, T>>) -> T
pub fn poly_variant(&self, fields: Vec<Field<Id, T>>, rest: T) -> T
pub fn record(
&self,
types: Vec<Field<Id, Alias<Id, T>>>,
fields: Vec<Field<Id, T>>
) -> T
pub fn effect(&self, fields: Vec<Field<Id, T>>) -> T
pub fn poly_effect(&self, fields: Vec<Field<Id, T>>, rest: T) -> T
pub fn builtin_type(&self, typ: BuiltinType) -> T
pub fn array(&self, typ: T) -> T
Trait Implementations
Auto Trait Implementations
impl<Id, T> RefUnwindSafe for TypeCache<Id, T>where
Id: RefUnwindSafe,
T: RefUnwindSafe,
impl<Id, T> Send for TypeCache<Id, T>where
Id: Send,
T: Send,
impl<Id, T> Sync for TypeCache<Id, T>where
Id: Sync,
T: Sync,
impl<Id, T> Unpin for TypeCache<Id, T>where
Id: Unpin,
T: Unpin,
impl<Id, T> UnwindSafe for TypeCache<Id, T>where
Id: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more