pub trait TypeTree {
// Required methods
fn is_subtype_of(&self, child: &NodeId, ancestor: &NodeId) -> bool;
fn get_node<'a>(&'a self, node: &NodeId) -> Option<TypeTreeNode<'a>>;
fn get(&self, node: &NodeId) -> Option<NodeClass>;
fn find_type_prop_by_browse_path(
&self,
type_id: &NodeId,
path: &[QualifiedName],
) -> Option<&TypeProperty>;
fn get_supertype<'a>(&'a self, node: &NodeId) -> Option<&'a NodeId>;
fn namespaces(&self) -> &NamespaceMap;
}Expand description
Trait for a type tree, a structure that provides methods to inspect type relationships. This is used for getting reference sub-types, and for events.
Required Methods§
Sourcefn is_subtype_of(&self, child: &NodeId, ancestor: &NodeId) -> bool
fn is_subtype_of(&self, child: &NodeId, ancestor: &NodeId) -> bool
Return true if child is a descendant of ancestor, meaning they
are connected with a chain of HasSubtype references.
Sourcefn get_node<'a>(&'a self, node: &NodeId) -> Option<TypeTreeNode<'a>>
fn get_node<'a>(&'a self, node: &NodeId) -> Option<TypeTreeNode<'a>>
Get a reference to the node with ID node.
Sourcefn get(&self, node: &NodeId) -> Option<NodeClass>
fn get(&self, node: &NodeId) -> Option<NodeClass>
Get the node class of a type in the type tree given by node.
Sourcefn find_type_prop_by_browse_path(
&self,
type_id: &NodeId,
path: &[QualifiedName],
) -> Option<&TypeProperty>
fn find_type_prop_by_browse_path( &self, type_id: &NodeId, path: &[QualifiedName], ) -> Option<&TypeProperty>
Find a property of a type from its browse path.
Sourcefn get_supertype<'a>(&'a self, node: &NodeId) -> Option<&'a NodeId>
fn get_supertype<'a>(&'a self, node: &NodeId) -> Option<&'a NodeId>
Get the supertype of the given node.
Sourcefn namespaces(&self) -> &NamespaceMap
fn namespaces(&self) -> &NamespaceMap
Get the namespace map used by this type tree.