[−][src]Struct elba::util::graph::Graph
A wrapper for petgraph::Graph
.
This graph is a directed acyclic graph; we always assume that the root node is at node index 0.
Fields
inner: Graph<T, E>
Methods
impl<T: Eq, E> Graph<T, E>
[src]
pub fn new(graph: Graph<T, E>) -> Self
[src]
pub fn find_id(&self, node: &T) -> Option<NodeIndex>
[src]
pub fn find_by<F>(&self, f: F) -> Option<&T> where
F: Fn(&T) -> bool,
[src]
F: Fn(&T) -> bool,
pub fn sub_tree<'a>(
&'a self,
root_id: NodeIndex
) -> impl Iterator<Item = (NodeIndex, &T)> + 'a
[src]
&'a self,
root_id: NodeIndex
) -> impl Iterator<Item = (NodeIndex, &T)> + 'a
Recursively traverse the entire sub tree of the given root, including the root itself
pub fn children<'a>(
&'a self,
parent_id: NodeIndex
) -> impl Iterator<Item = (NodeIndex, &T)> + 'a
[src]
&'a self,
parent_id: NodeIndex
) -> impl Iterator<Item = (NodeIndex, &T)> + 'a
Traverse all direct children of the given node
pub fn parents<'a>(
&'a self,
child_id: NodeIndex
) -> impl Iterator<Item = (NodeIndex, &T)> + 'a
[src]
&'a self,
child_id: NodeIndex
) -> impl Iterator<Item = (NodeIndex, &T)> + 'a
Traverse all direct parents of the given node
pub fn map<U, V, F, G>(&self, f: F, g: G) -> Res<Graph<U, V>> where
U: Eq,
F: FnMut(NodeIndex, &T) -> Res<U>,
G: FnMut(&E) -> Res<V>,
[src]
U: Eq,
F: FnMut(NodeIndex, &T) -> Res<U>,
G: FnMut(&E) -> Res<V>,
pub fn filter_map<U, V, F, G>(&mut self, f: F, g: G) -> Graph<U, V> where
U: Eq,
F: FnMut(&T) -> Option<U>,
G: FnMut(&E) -> Option<V>,
[src]
U: Eq,
F: FnMut(&T) -> Option<U>,
G: FnMut(&E) -> Option<V>,
Trait Implementations
impl Into<LockfileToml> for Graph<Summary>
[src]
fn into(self) -> LockfileToml
[src]
impl<T: Clone, E: Clone> Clone for Graph<T, E> where
T: Eq,
[src]
T: Eq,
fn clone(&self) -> Graph<T, E>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<LockfileToml> for Graph<Summary>
[src]
fn from(f: LockfileToml) -> Self
[src]
impl<T> Default for Graph<T> where
T: Eq,
[src]
T: Eq,
impl<T: Debug, E: Debug> Debug for Graph<T, E> where
T: Eq,
[src]
T: Eq,
impl<T, E> Index<NodeIndex<u32>> for Graph<T, E> where
T: Eq,
[src]
T: Eq,
impl<T, E> IndexMut<NodeIndex<u32>> for Graph<T, E> where
T: Eq,
[src]
T: Eq,
Auto Trait Implementations
impl<T, E> Send for Graph<T, E> where
E: Send,
T: Send,
E: Send,
T: Send,
impl<T, E> Sync for Graph<T, E> where
E: Sync,
T: Sync,
E: Sync,
T: Sync,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self