Struct debris_common::graph::GraphLoopDetector
source · pub struct GraphLoopDetector {
to_visit: FxHashSet<u32>,
visited: FxHashSet<u32>,
}
Expand description
Detects loops in a graph. This is a custom struct in order to save on allocations in hot code.
Fields§
§to_visit: FxHashSet<u32>
§visited: FxHashSet<u32>
Implementations§
source§impl GraphLoopDetector
impl GraphLoopDetector
sourcepub fn has_loop<T>(&mut self, graph: &GraphMatrix<T>, node: u32) -> bool
pub fn has_loop<T>(&mut self, graph: &GraphMatrix<T>, node: u32) -> bool
Returns true
if the graph has a loop which is reachable from node
.
Trait Implementations§
source§impl Default for GraphLoopDetector
impl Default for GraphLoopDetector
source§fn default() -> GraphLoopDetector
fn default() -> GraphLoopDetector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for GraphLoopDetector
impl Send for GraphLoopDetector
impl Sync for GraphLoopDetector
impl Unpin for GraphLoopDetector
impl UnwindSafe for GraphLoopDetector
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