pub struct Closure { /* private fields */ }Expand description
The ancestor and descendant sets of every node.
Implementations§
Source§impl Closure
impl Closure
Sourcepub fn compute(is_a: &Csr) -> Result<Self, ClosureError>
pub fn compute(is_a: &Csr) -> Result<Self, ClosureError>
Computes the closure of is_a, whose edges point from child to parent.
§Errors
Returns ClosureError::Cycle when the edges are not acyclic.
Sourcepub fn from_parts(
ancestors: Vec<RoaringBitmap>,
descendants: Vec<RoaringBitmap>,
) -> Self
pub fn from_parts( ancestors: Vec<RoaringBitmap>, descendants: Vec<RoaringBitmap>, ) -> Self
Reassembles a closure from its two bitmap lists.
Sourcepub fn ancestors(&self, node: Ordinal) -> &RoaringBitmap
pub fn ancestors(&self, node: Ordinal) -> &RoaringBitmap
The proper ancestors of node (ECL >); empty for an unknown node.
Sourcepub fn descendants(&self, node: Ordinal) -> &RoaringBitmap
pub fn descendants(&self, node: Ordinal) -> &RoaringBitmap
The proper descendants of node (ECL <); empty for an unknown node.
Sourcepub fn descendants_or_self(&self, node: Ordinal) -> RoaringBitmap
pub fn descendants_or_self(&self, node: Ordinal) -> RoaringBitmap
node and its descendants (ECL <<).
Sourcepub fn ancestors_or_self(&self, node: Ordinal) -> RoaringBitmap
pub fn ancestors_or_self(&self, node: Ordinal) -> RoaringBitmap
node and its ancestors (ECL >>).
Sourcepub fn is_ancestor(&self, ancestor: Ordinal, node: Ordinal) -> bool
pub fn is_ancestor(&self, ancestor: Ordinal, node: Ordinal) -> bool
Whether ancestor is a proper ancestor of node.
Sourcepub fn ancestor_sets(&self) -> &[RoaringBitmap]
pub fn ancestor_sets(&self) -> &[RoaringBitmap]
The ancestor bitmaps, in ordinal order.
Sourcepub fn descendant_sets(&self) -> &[RoaringBitmap]
pub fn descendant_sets(&self) -> &[RoaringBitmap]
The descendant bitmaps, in ordinal order.
Trait Implementations§
impl Eq for Closure
impl StructuralPartialEq for Closure
Auto Trait Implementations§
impl Freeze for Closure
impl RefUnwindSafe for Closure
impl Send for Closure
impl Sync for Closure
impl Unpin for Closure
impl UnsafeUnpin for Closure
impl UnwindSafe for Closure
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