pub struct GraphAnalyzer { /* private fields */ }Expand description
Analyzes a directed acyclic graph represented as an adjacency list.
Nodes are represented by u64 IDs; edges as (from, to) pairs.
Implementations§
Source§impl GraphAnalyzer
impl GraphAnalyzer
Sourcepub fn add_edge(&mut self, from: u64, to: u64)
pub fn add_edge(&mut self, from: u64, to: u64)
Adds a directed edge from from to to, implicitly adding both nodes.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Returns the total number of directed edges.
Sourcepub fn analyze(&self) -> GraphStats
pub fn analyze(&self) -> GraphStats
Computes and returns a GraphStats snapshot.
Trait Implementations§
Source§impl Clone for GraphAnalyzer
impl Clone for GraphAnalyzer
Source§fn clone(&self) -> GraphAnalyzer
fn clone(&self) -> GraphAnalyzer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphAnalyzer
impl Debug for GraphAnalyzer
Source§impl Default for GraphAnalyzer
impl Default for GraphAnalyzer
Source§fn default() -> GraphAnalyzer
fn default() -> GraphAnalyzer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GraphAnalyzer
impl RefUnwindSafe for GraphAnalyzer
impl Send for GraphAnalyzer
impl Sync for GraphAnalyzer
impl Unpin for GraphAnalyzer
impl UnsafeUnpin for GraphAnalyzer
impl UnwindSafe for GraphAnalyzer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more