pub struct TypeCache { /* private fields */ }
Expand description
Type cache for interning and deduplicating types in the system
Implementations§
Source§impl TypeCache
impl TypeCache
pub const fn type_id_to_type(&self) -> &SeqMap<TypeId, Rc<Type>>
pub const fn compatible_cache(&self) -> &SeqMap<(TypeId, TypeId), bool>
Sourcepub fn compatible_with(&mut self, a: &Type, b: &Type) -> bool
pub fn compatible_with(&mut self, a: &Type, b: &Type) -> bool
Check if two types are compatible
Sourcepub fn clear_compatibility_cache(&mut self)
pub fn clear_compatibility_cache(&mut self)
Clear the compatibility cache
pub fn never(&mut self) -> Rc<Type>
pub fn byte(&mut self) -> Rc<Type>
pub fn short(&mut self) -> Rc<Type>
pub fn int(&mut self) -> Rc<Type>
pub fn codepoint(&mut self) -> Rc<Type>
pub fn float(&mut self) -> Rc<Type>
pub fn bool(&mut self) -> Rc<Type>
pub fn unit(&mut self) -> Rc<Type>
pub fn optional(&mut self, inner_type: &Rc<Type>) -> Rc<Type>
pub fn tuple(&mut self, element_types: Vec<Rc<Type>>) -> Rc<Type>
pub fn string_storage(&mut self, capacity: usize) -> Rc<Type>
pub fn string(&mut self) -> Rc<Type>
pub fn ptr(&mut self, inner_type: Rc<Type>) -> Rc<Type>
pub fn vec_storage( &mut self, element_type: &Rc<Type>, capacity: usize, ) -> Rc<Type>
pub fn sparse_storage( &mut self, element_type: &Rc<Type>, capacity: usize, ) -> Rc<Type>
pub fn queue_storage( &mut self, element_type: &Rc<Type>, capacity: usize, ) -> Rc<Type>
pub fn stack_storage( &mut self, element_type: &Rc<Type>, capacity: usize, ) -> Rc<Type>
pub fn map_storage( &mut self, key_type: &Rc<Type>, value_type: &Rc<Type>, capacity: usize, ) -> Rc<Type>
pub fn grid_storage( &mut self, element_type: &Rc<Type>, rows: usize, cols: usize, ) -> Rc<Type>
pub fn fixed_array(&mut self, element_type: &Rc<Type>, size: usize) -> Rc<Type>
pub fn slice_view(&mut self, element_type: &Rc<Type>) -> Rc<Type>
pub fn sparse_view(&mut self, element_type: &Rc<Type>) -> Rc<Type>
pub fn queue_view(&mut self, element_type: &Rc<Type>) -> Rc<Type>
pub fn stack_view(&mut self, element_type: &Rc<Type>) -> Rc<Type>
pub fn any(&mut self) -> Rc<Type>
pub fn dynamic_vec_view(&mut self, element_type: &Rc<Type>) -> Rc<Type>
pub fn dynamic_map_view( &mut self, key_type: &Rc<Type>, value_type: &Rc<Type>, ) -> Rc<Type>
pub fn grid_view(&mut self, element_type: &Rc<Type>) -> Rc<Type>
Sourcepub fn anonymous_struct(&mut self, anon_struct: AnonymousStructType) -> Rc<Type>
pub fn anonymous_struct(&mut self, anon_struct: AnonymousStructType) -> Rc<Type>
Create an anonymous struct type
pub fn range(&mut self, range_struct_ref: Rc<Type>) -> Rc<Type>
pub fn range_int(&mut self) -> Rc<Type>
pub fn named_struct(&mut self, named_struct: NamedStructType) -> Rc<Type>
pub fn enum_type(&mut self, enum_type: EnumType) -> Rc<Type>
pub fn function(&mut self, signature: Signature) -> Rc<Type>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeCache
impl RefUnwindSafe for TypeCache
impl !Send for TypeCache
impl !Sync for TypeCache
impl Unpin for TypeCache
impl UnwindSafe for TypeCache
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