pub trait TType {
Show 13 methods
// Required methods
fn needs_population(&self) -> bool;
fn is_expandable(&self) -> bool;
fn is_complex(&self) -> bool;
fn get_id(&self) -> Atom;
fn get_pretty_id_with_indent(&self, indent: usize) -> 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 { ... }
fn get_pretty_id(&self) -> Atom { ... }
}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
Sourcefn is_complex(&self) -> bool
fn is_complex(&self) -> bool
Returns true if this type has complex structure that benefits from multiline formatting when used as a generic parameter.
Sourcefn get_id(&self) -> Atom
fn get_id(&self) -> Atom
Return a human-readable atom for this type, which is suitable for use in error messages or debugging.
The resulting identifier must be unique for the type, but it does not have to be globally unique.
fn get_pretty_id_with_indent(&self, indent: usize) -> Atom
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.
fn get_pretty_id(&self) -> Atom
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 TObjectWithProperties
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.