mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 09:23:05 +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
|
&self.nodes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn len_nodes(&self) -> usize {
|
||||||
|
self.nodes.len()
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn all_edges<'a>(&'a self) -> &'a [Edge<E>] {
|
pub fn all_edges<'a>(&'a self) -> &'a [Edge<E>] {
|
||||||
&self.edges
|
&self.edges
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn len_edges(&self) -> usize {
|
||||||
|
self.edges.len()
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// Node construction
|
// Node construction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user