pub struct TaxonomyTree { /* private fields */ }Expand description
Unified inheritance graph for Haystack 4 defs.
Supports multiple inheritance (a def can have multiple supertypes via
the is tag). Pre-computes mandatory marker sets on first access
for fast fits() evaluation.
Implementations§
Source§impl TaxonomyTree
impl TaxonomyTree
Sourcepub fn is_subtype(&self, child: &str, parent: &str) -> bool
pub fn is_subtype(&self, child: &str, parent: &str) -> bool
Check if child is a subtype of parent.
Uses BFS up the parent chain. Returns true if child
equals parent or if parent is an ancestor.
Sourcepub fn supertypes_of(&self, name: &str) -> Vec<String>
pub fn supertypes_of(&self, name: &str) -> Vec<String>
Full ancestor chain (transitive, breadth-first).
Returns all ancestors of name, nearest first.
Sourcepub fn subtypes_of(&self, name: &str) -> Vec<String>
pub fn subtypes_of(&self, name: &str) -> Vec<String>
Direct children of a type.
Sourcepub fn all_subtypes(&self, name: &str) -> Vec<String>
pub fn all_subtypes(&self, name: &str) -> Vec<String>
All descendants (transitive, breadth-first).
Get mandatory marker tags for a type.
Walks the supertype chain and collects all types that are marked as mandatory. Results are cached.
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear the mandatory tag cache (used after library unload).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TaxonomyTree
impl !RefUnwindSafe for TaxonomyTree
impl Send for TaxonomyTree
impl Sync for TaxonomyTree
impl Unpin for TaxonomyTree
impl UnsafeUnpin for TaxonomyTree
impl UnwindSafe for TaxonomyTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more