Skip to main content

TypeTree

Trait TypeTree 

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

Source

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.

Source

fn get_node<'a>(&'a self, node: &NodeId) -> Option<TypeTreeNode<'a>>

Get a reference to the node with ID node.

Source

fn get(&self, node: &NodeId) -> Option<NodeClass>

Get the node class of a type in the type tree given by node.

Source

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.

Source

fn get_supertype<'a>(&'a self, node: &NodeId) -> Option<&'a NodeId>

Get the supertype of the given node.

Source

fn namespaces(&self) -> &NamespaceMap

Get the namespace map used by this type tree.

Implementors§