TType

Trait TType 

Source
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§

Source

fn needs_population(&self) -> bool

Source

fn is_expandable(&self) -> bool

Source

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.

Provided Methods§

Source

fn get_child_nodes<'a>(&'a self) -> Vec<TypeRef<'a>>

Returns a vector of child type nodes that this type contains.

Source

fn get_all_child_nodes<'a>(&'a self) -> Vec<TypeRef<'a>>

Returns a vector of all child type nodes, including nested ones.

Source

fn can_be_intersected(&self) -> bool

Checks if this type can have intersection types (&B&S).

Source

fn get_intersection_types(&self) -> Option<&[TAtomic]>

Returns a slice of the additional intersection types (&B&S), if any. Contains boxed atomic types.

Source

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.

Source

fn has_intersection_types(&self) -> bool

Checks if this type has intersection types.

Source

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§