pub trait TType {
// Required methods
fn needs_population(&self) -> bool;
fn is_expandable(&self) -> bool;
fn get_id(&self) -> Atom;
// Provided methods
fn get_child_nodes<'a>(&'a self) -> Vec<TypeRef<'a>> { ... }
fn get_all_child_nodes<'a>(&'a self) -> Vec<TypeRef<'a>> { ... }
fn can_be_intersected(&self) -> bool { ... }
fn get_intersection_types(&self) -> Option<&[TAtomic]> { ... }
fn get_intersection_types_mut(&mut self) -> Option<&mut Vec<TAtomic>> { ... }
fn has_intersection_types(&self) -> bool { ... }
fn add_intersection_type(&mut self, _intersection_type: TAtomic) -> bool { ... }
}Expand description
A trait to be implemented by all types in the type system.
Required Methods§
fn needs_population(&self) -> bool
fn is_expandable(&self) -> bool
Provided Methods§
Sourcefn get_child_nodes<'a>(&'a self) -> Vec<TypeRef<'a>>
fn get_child_nodes<'a>(&'a self) -> Vec<TypeRef<'a>>
Returns a vector of child type nodes that this type contains.
Sourcefn get_all_child_nodes<'a>(&'a self) -> Vec<TypeRef<'a>>
fn get_all_child_nodes<'a>(&'a self) -> Vec<TypeRef<'a>>
Returns a vector of all child type nodes, including nested ones.
Sourcefn can_be_intersected(&self) -> bool
fn can_be_intersected(&self) -> bool
Checks if this type can have intersection types (&B&S).
Sourcefn get_intersection_types(&self) -> Option<&[TAtomic]>
fn get_intersection_types(&self) -> Option<&[TAtomic]>
Returns a slice of the additional intersection types (&B&S), if any. Contains boxed atomic types.
Sourcefn get_intersection_types_mut(&mut self) -> Option<&mut Vec<TAtomic>>
fn get_intersection_types_mut(&mut self) -> Option<&mut Vec<TAtomic>>
Returns a mutable slice of the additional intersection types (&B&S), if any. Contains boxed atomic types.
Sourcefn has_intersection_types(&self) -> bool
fn has_intersection_types(&self) -> bool
Checks if this type has intersection types.
Sourcefn add_intersection_type(&mut self, _intersection_type: TAtomic) -> bool
fn add_intersection_type(&mut self, _intersection_type: TAtomic) -> bool
Adds an intersection type to this type.
Returns true if the intersection type was added successfully,
or false if this type does not support intersection types.
Implementors§
impl TType for TArray
impl TType for TCallable
impl TType for TDerived
impl TType for TAtomic
impl TType for TObject
impl TType for TReference
impl TType for TClassLikeString
impl TType for TScalar
impl TType for TInteger
impl TType for TKeyedArray
impl TType for TList
impl TType for TConditional
impl TType for TKeyOf
impl TType for TPropertiesOf
impl TType for TValueOf
impl TType for TGenericParameter
impl TType for TIterable
impl TType for TMixed
impl TType for TEnum
impl TType for TNamedObject
impl TType for TResource
impl TType for TBool
impl TType for TFloat
impl TType for TString
impl TType for TUnion
impl<'a> TType for TypeRef<'a>
Implements the TType trait for TypeRef.