pub struct GraphQuery<'a, N, E>(pub &'a StableGraph<N, E>);Expand description
A wrapper for ascertaining the structure of the underlying graph.
This type is used in forward_traverse_mut callbacks.
Tuple Fields§
§0: &'a StableGraph<N, E>Implementations§
Source§impl<'a, N, E> GraphQuery<'a, N, E>
impl<'a, N, E> GraphQuery<'a, N, E>
Sourcepub fn new(ir: &'a StableGraph<N, E>) -> Self
pub fn new(ir: &'a StableGraph<N, E>) -> Self
Creates a new GraphQuery from a reference to a
StableGraph.
Sourcepub fn neighbors_directed(
&self,
x: NodeIndex,
direction: Direction,
) -> Neighbors<'_, E>
pub fn neighbors_directed( &self, x: NodeIndex, direction: Direction, ) -> Neighbors<'_, E>
Gets information about the immediate parent or child nodes of the node at the given index.
§Remarks
Direction::Outgoing gives children, while
Direction::Incoming gives parents.
Sourcepub fn edges_directed(
&self,
x: NodeIndex,
direction: Direction,
) -> Edges<'_, E, Directed>
pub fn edges_directed( &self, x: NodeIndex, direction: Direction, ) -> Edges<'_, E, Directed>
Gets edges pointing at the parent or child nodes of the node at the given index.
§Remarks
Direction::Outgoing gives children, while
Direction::Incoming gives parents.
Trait Implementations§
Source§impl<'a, N, E> From<&'a StableGraph<N, E>> for GraphQuery<'a, N, E>
impl<'a, N, E> From<&'a StableGraph<N, E>> for GraphQuery<'a, N, E>
Source§fn from(x: &'a StableGraph<N, E>) -> Self
fn from(x: &'a StableGraph<N, E>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a, N, E> Freeze for GraphQuery<'a, N, E>
impl<'a, N, E> RefUnwindSafe for GraphQuery<'a, N, E>where
N: RefUnwindSafe,
E: RefUnwindSafe,
impl<'a, N, E> Send for GraphQuery<'a, N, E>
impl<'a, N, E> Sync for GraphQuery<'a, N, E>
impl<'a, N, E> Unpin for GraphQuery<'a, N, E>
impl<'a, N, E> UnsafeUnpin for GraphQuery<'a, N, E>
impl<'a, N, E> UnwindSafe for GraphQuery<'a, N, E>where
N: RefUnwindSafe,
E: RefUnwindSafe,
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.