mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
add a few accessors to Graph
This commit is contained in:
parent
004d70212a
commit
4f5267dba3
@ -119,11 +119,21 @@ impl<N:Debug,E:Debug> Graph<N,E> {
|
||||
&self.nodes
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn len_nodes(&self) -> usize {
|
||||
self.nodes.len()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn all_edges<'a>(&'a self) -> &'a [Edge<E>] {
|
||||
&self.edges
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn len_edges(&self) -> usize {
|
||||
self.edges.len()
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Node construction
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user