[−][src]Struct gchemol_graph::NxGraph
networkx-like API wrapper around petgraph
Methods
impl<N, E> NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
impl<N, E> NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
pub fn neighbors(
&self,
current: NodeIndex
) -> impl Iterator<Item = NodeIndex> + '_
[src]
&self,
current: NodeIndex
) -> impl Iterator<Item = NodeIndex> + '_
Return neighboring nodes of current
node.
pub fn has_node(&self, n: NodeIndex) -> bool
[src]
pub fn has_edge(&self, u: NodeIndex, v: NodeIndex) -> bool
[src]
Returns true if the edge (u, v) is in the graph.
pub fn number_of_nodes(&self) -> usize
[src]
Returns the number of nodes in the graph.
pub fn number_of_edges(&self) -> usize
[src]
Returns the number of edges in the graph.
impl<N, E> NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
pub fn add_node(&mut self, data: N) -> NodeIndex
[src]
Add a node with associated data into graph.
pub fn add_edge(&mut self, u: NodeIndex, v: NodeIndex, data: E)
[src]
Add an edge with data
between u
and v
.
pub fn remove_edge(&mut self, node1: NodeIndex, node2: NodeIndex) -> Option<E>
[src]
Remove an edge between node1
and node2
. Return None if trying to
remove a non-existent edge.
pub fn remove_node(&mut self, n: NodeIndex) -> Option<N>
[src]
Removes the node n
and all adjacent edges. Return None if trying to
remove a non-existent node.
pub fn clear(&mut self)
[src]
Remove all nodes and edges
impl<N, E> NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
ⓘImportant traits for Nodes<'a, N, E>pub fn nodes(&self) -> Nodes<N, E>
[src]
ⓘImportant traits for Nodes<'a, N, E>
A Node view of the Graph.
ⓘImportant traits for Edges<'a, N, E>pub fn edges(&self) -> Edges<N, E>
[src]
ⓘImportant traits for Edges<'a, N, E>
An Edge view of the Graph.
Trait Implementations
impl<N: Clone, E: Clone> Clone for NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
impl<N: Debug, E: Debug> Debug for NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
impl<N: Default, E: Default> Default for NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
impl<'de, N, E> Deserialize<'de> for NxGraph<N, E> where
N: Default,
E: Default,
N: Deserialize<'de>,
E: Deserialize<'de>,
[src]
N: Default,
E: Default,
N: Deserialize<'de>,
E: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<N, E> Index<(NodeIndex<u32>, NodeIndex<u32>)> for NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
type Output = E
The returned type after indexing.
fn index(&self, e: (NodeIndex, NodeIndex)) -> &Self::Output
[src]
impl<N, E> Index<NodeIndex<u32>> for NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
type Output = N
The returned type after indexing.
fn index(&self, n: NodeIndex) -> &Self::Output
[src]
impl<N, E> IndexMut<(NodeIndex<u32>, NodeIndex<u32>)> for NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
impl<N, E> IndexMut<NodeIndex<u32>> for NxGraph<N, E> where
N: Default,
E: Default,
[src]
N: Default,
E: Default,
impl<N, E> Serialize for NxGraph<N, E> where
N: Default,
E: Default,
N: Serialize,
E: Serialize,
[src]
N: Default,
E: Default,
N: Serialize,
E: Serialize,
Auto Trait Implementations
impl<N, E> RefUnwindSafe for NxGraph<N, E> where
E: RefUnwindSafe,
N: RefUnwindSafe,
E: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, E> Send for NxGraph<N, E> where
E: Send,
N: Send,
E: Send,
N: Send,
impl<N, E> Sync for NxGraph<N, E> where
E: Sync,
N: Sync,
E: Sync,
N: Sync,
impl<N, E> Unpin for NxGraph<N, E> where
E: Unpin,
N: Unpin,
E: Unpin,
N: Unpin,
impl<N, E> UnwindSafe for NxGraph<N, E> where
E: UnwindSafe,
N: UnwindSafe,
E: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> 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>,