Expand description
A Directed acyclic graph (DAG) data structure.
Dag is a thin wrapper around petgraph’s Graph
data structure, providing a refined API for
dealing specifically with DAGs.
Note: The following documentation is adapted from petgraph’s Graph documentation
Dag is parameterized over the node weight N, edge weight E and index type Ix.
NodeIndex is a type that acts as a reference to nodes, but these are only stable across certain operations. Removing nodes may shift other indices. Adding kids to the Dag keeps all indices stable, but removing a node will force the last node to shift its index to take its place.
The fact that the node indices in the Dag are numbered in a compact interval from 0 to n-1 simplifies some graph algorithms.
The Ix parameter is u32 by default. The goal is that you can ignore this parameter completely unless you need a very large Dag – then you can use usize.
The Dag also offers methods for accessing the underlying Graph, which can be useful for taking advantage of petgraph’s various graph-related algorithms.
Implementations
sourceimpl<N, E, Ix> Dag<N, E, Ix> where
Ix: IndexType,
impl<N, E, Ix> Dag<N, E, Ix> where
Ix: IndexType,
sourcepub fn with_capacity(nodes: usize, edges: usize) -> Self
pub fn with_capacity(nodes: usize, edges: usize) -> Self
Create a new Dag
with estimated capacity for its node and edge Vecs.
sourcepub fn from_edges<I>(edges: I) -> Result<Self, WouldCycle<E>> where
I: IntoIterator,
I::Item: IntoWeightedEdge<E>,
<I::Item as IntoWeightedEdge<E>>::NodeId: Into<NodeIndex<Ix>>,
N: Default,
pub fn from_edges<I>(edges: I) -> Result<Self, WouldCycle<E>> where
I: IntoIterator,
I::Item: IntoWeightedEdge<E>,
<I::Item as IntoWeightedEdge<E>>::NodeId: Into<NodeIndex<Ix>>,
N: Default,
Create a Dag
from an iterator yielding edges.
Node weights N
are set to default values.
Edge
weights E
may either be specified in the list, or they are filled with default
values.
Nodes are inserted automatically to match the edges.
Returns an Err
if adding any of the edges would cause a cycle.
sourcepub fn extend_with_edges<I>(&mut self, edges: I) -> Result<(), WouldCycle<E>> where
I: IntoIterator,
I::Item: IntoWeightedEdge<E>,
<I::Item as IntoWeightedEdge<E>>::NodeId: Into<NodeIndex<Ix>>,
N: Default,
pub fn extend_with_edges<I>(&mut self, edges: I) -> Result<(), WouldCycle<E>> where
I: IntoIterator,
I::Item: IntoWeightedEdge<E>,
<I::Item as IntoWeightedEdge<E>>::NodeId: Into<NodeIndex<Ix>>,
N: Default,
Extend the Dag
with the given edges.
Node weights N
are set to default values.
Edge weights E
may either be specified in the list, or they are filled with default
values.
Nodes are inserted automatically to match the edges.
Returns an Err
if adding an edge would cause a cycle.
sourcepub fn from_elements<I>(elements: I) -> Result<Self, WouldCycle<E>> where
Self: Sized,
I: IntoIterator<Item = Element<N, E>>,
pub fn from_elements<I>(elements: I) -> Result<Self, WouldCycle<E>> where
Self: Sized,
I: IntoIterator<Item = Element<N, E>>,
Create a Dag
from an iterator yielding elements.
Returns an Err
if an edge would cause a cycle within the graph.
sourcepub fn map<'a, F, G, N2, E2>(
&'a self,
node_map: F,
edge_map: G
) -> Dag<N2, E2, Ix> where
F: FnMut(NodeIndex<Ix>, &'a N) -> N2,
G: FnMut(EdgeIndex<Ix>, &'a E) -> E2,
pub fn map<'a, F, G, N2, E2>(
&'a self,
node_map: F,
edge_map: G
) -> Dag<N2, E2, Ix> where
F: FnMut(NodeIndex<Ix>, &'a N) -> N2,
G: FnMut(EdgeIndex<Ix>, &'a E) -> E2,
Create a new Graph
by mapping node and edge weights to new values.
The resulting graph has the same structure and the same graph indices as self
.
sourcepub fn filter_map<'a, F, G, N2, E2>(
&'a self,
node_map: F,
edge_map: G
) -> Dag<N2, E2, Ix> where
F: FnMut(NodeIndex<Ix>, &'a N) -> Option<N2>,
G: FnMut(EdgeIndex<Ix>, &'a E) -> Option<E2>,
pub fn filter_map<'a, F, G, N2, E2>(
&'a self,
node_map: F,
edge_map: G
) -> Dag<N2, E2, Ix> where
F: FnMut(NodeIndex<Ix>, &'a N) -> Option<N2>,
G: FnMut(EdgeIndex<Ix>, &'a E) -> Option<E2>,
Create a new Dag
by mapping node and edge weights. A node or edge may be mapped to None
to exclude it from the resulting Dag
.
Nodes are mapped first with the node_map
closure, then edge_map
is called for the edges
that have not had any endpoint removed.
The resulting graph has the structure of a subgraph of the original graph. If no nodes are removed, the resulting graph has compatible node indices.
If neither nodes nor edges are removed, the resulting graph has compatible node indices. If
neither nodes nor edges are removed the result has the same graph indices as self
.
The resulting graph has the same structure and the same graph indices as self
.
sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
The total number of nodes in the Dag.
sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
The total number of edges in the Dag.
sourcepub fn graph(&self) -> &DiGraph<N, E, Ix>
pub fn graph(&self) -> &DiGraph<N, E, Ix>
Borrow the Dag
’s underlying DiGraph<N, Ix>
.
All existing indices may be used to index into this DiGraph
the same way they may be
used to index into the Dag
.
sourcepub fn into_graph(self) -> DiGraph<N, E, Ix>
pub fn into_graph(self) -> DiGraph<N, E, Ix>
Take ownership of the Dag
and return the internal DiGraph
.
All existing indices may be used to index into this DiGraph
the same way they may be
used to index into the Dag
.
sourcepub fn add_node(&mut self, weight: N) -> NodeIndex<Ix>
pub fn add_node(&mut self, weight: N) -> NodeIndex<Ix>
Add a new node to the Dag
with the given weight.
Computes in O(1) time.
Returns the index of the new node.
Note: If you’re adding a new node and immediately adding a single edge to that node from some other node, consider using the add_child or add_parent methods instead for better performance.
Panics if the Graph is at the maximum number of nodes for its index type.
sourcepub fn add_edge(
&mut self,
a: NodeIndex<Ix>,
b: NodeIndex<Ix>,
weight: E
) -> Result<EdgeIndex<Ix>, WouldCycle<E>>
pub fn add_edge(
&mut self,
a: NodeIndex<Ix>,
b: NodeIndex<Ix>,
weight: E
) -> Result<EdgeIndex<Ix>, WouldCycle<E>>
Add a new directed edge to the Dag
with the given weight.
The added edge will be in the direction a
-> b
Checks if the edge would create a cycle in the Graph.
If adding the edge would not cause the graph to cycle, the edge will be added and its
EdgeIndex
returned.
If adding the edge would cause the graph to cycle, the edge will not be added and
instead a WouldCycle<E>
error with the given weight will be returned.
In the worst case, petgraph’s is_cyclic_directed
function is used to check whether or not adding the edge would create a cycle.
Note: Dag allows adding parallel (“duplicate”) edges. If you want to avoid this, use
update_edge
instead.
Note: If you’re adding a new node and immediately adding a single edge to that node from some other node, consider using the add_child or add_parent methods instead for better performance.
Panics if either a
or b
do not exist within the Dag.
Panics if the Graph is at the maximum number of edges for its index type.
sourcepub fn add_edges<I>(
&mut self,
edges: I
) -> Result<EdgeIndices<Ix>, WouldCycle<Vec<E>>> where
I: IntoIterator<Item = (NodeIndex<Ix>, NodeIndex<Ix>, E)>,
pub fn add_edges<I>(
&mut self,
edges: I
) -> Result<EdgeIndices<Ix>, WouldCycle<Vec<E>>> where
I: IntoIterator<Item = (NodeIndex<Ix>, NodeIndex<Ix>, E)>,
Adds the given directed edges to the Dag
, each with their own given weight.
The given iterator should yield a NodeIndex
pair along with a weight for each Edge to be
added in a tuple.
If we were to describe the tuple as (a, b, weight), the connection would be directed as follows:
a -> b
This method behaves similarly to the add_edge
method, however rather than checking whether or not a cycle has been created after adding
each edge, it only checks after all edges have been added. This makes it a slightly more
performant and ergonomic option that repeatedly calling add_edge
.
If adding the edges would not cause the graph to cycle, the edges will be added and
their indices returned in an EdgeIndices
iterator, yielding indices for each edge in the
same order that they were given.
If adding the edges would cause the graph to cycle, the edges will not be added and
instead a WouldCycle<Vec<E>>
error with the unused weights will be returned. The order of
the returned Vec
will be the reverse of the given order.
Note: Dag allows adding parallel (“duplicate”) edges. If you want to avoid this, use
update_edge
instead.
Note: If you’re adding a series of new nodes and edges to a single node, consider using the add_child or add_parent methods instead for greater convenience.
Panics if the Graph is at the maximum number of nodes for its index type.
sourcepub fn update_edge(
&mut self,
a: NodeIndex<Ix>,
b: NodeIndex<Ix>,
weight: E
) -> Result<EdgeIndex<Ix>, WouldCycle<E>>
pub fn update_edge(
&mut self,
a: NodeIndex<Ix>,
b: NodeIndex<Ix>,
weight: E
) -> Result<EdgeIndex<Ix>, WouldCycle<E>>
Update the edge from nodes a
-> b
with the given weight.
If the edge doesn’t already exist, it will be added using the add_edge
method.
Please read the add_edge
for more important details.
Checks if the edge would create a cycle in the Graph.
Computes in O(t + e) time where “t” is the complexity of add_edge
and e is the number
of edges connected to the nodes a and b.
Returns the index of the edge, or a WouldCycle
error if adding the edge would create a
cycle.
Note: If you’re adding a new node and immediately adding a single edge to that node from
some parent node, consider using the add_child
method instead for greater convenience.
Panics if the Graph is at the maximum number of nodes for its index type.
sourcepub fn find_edge(
&self,
a: NodeIndex<Ix>,
b: NodeIndex<Ix>
) -> Option<EdgeIndex<Ix>>
pub fn find_edge(
&self,
a: NodeIndex<Ix>,
b: NodeIndex<Ix>
) -> Option<EdgeIndex<Ix>>
Find and return the index to the edge that describes a
-> b
if there is one.
Computes in O(e’) time, where e’ is the number of edges connected to the nodes a
and b
.
sourcepub fn edge_endpoints(
&self,
e: EdgeIndex<Ix>
) -> Option<(NodeIndex<Ix>, NodeIndex<Ix>)>
pub fn edge_endpoints(
&self,
e: EdgeIndex<Ix>
) -> Option<(NodeIndex<Ix>, NodeIndex<Ix>)>
Access the parent and child nodes for the given EdgeIndex
.
sourcepub fn clear_edges(&mut self)
pub fn clear_edges(&mut self)
Remove all edges.
sourcepub fn add_parent(
&mut self,
child: NodeIndex<Ix>,
edge: E,
node: N
) -> (EdgeIndex<Ix>, NodeIndex<Ix>)
pub fn add_parent(
&mut self,
child: NodeIndex<Ix>,
edge: E,
node: N
) -> (EdgeIndex<Ix>, NodeIndex<Ix>)
Add a new edge and parent node to the node at the given NodeIndex
.
Returns both the edge’s EdgeIndex
and the node’s NodeIndex
.
node -> edge -> child
Computes in O(1) time.
This is faster than using add_node
and add_edge
. This is because we don’t have to check
if the graph would cycle when adding an edge to the new node, as we know it it will be the
only edge connected to that node.
Panics if the given child node doesn’t exist.
Panics if the Graph is at the maximum number of edges for its index.
sourcepub fn add_child(
&mut self,
parent: NodeIndex<Ix>,
edge: E,
node: N
) -> (EdgeIndex<Ix>, NodeIndex<Ix>)
pub fn add_child(
&mut self,
parent: NodeIndex<Ix>,
edge: E,
node: N
) -> (EdgeIndex<Ix>, NodeIndex<Ix>)
Add a new edge and child node to the node at the given NodeIndex
.
Returns both the edge’s EdgeIndex
and the node’s NodeIndex
.
child -> edge -> node
Computes in O(1) time.
This is faster than using add_node
and add_edge
. This is because we don’t have to check
if the graph would cycle when adding an edge to the new node, as we know it it will be the
only edge connected to that node.
Panics if the given parent node doesn’t exist.
Panics if the Graph is at the maximum number of edges for its index.
sourcepub fn node_weight(&self, node: NodeIndex<Ix>) -> Option<&N>
pub fn node_weight(&self, node: NodeIndex<Ix>) -> Option<&N>
Borrow the weight from the node at the given index.
sourcepub fn node_weight_mut(&mut self, node: NodeIndex<Ix>) -> Option<&mut N>
pub fn node_weight_mut(&mut self, node: NodeIndex<Ix>) -> Option<&mut N>
Mutably borrow the weight from the node at the given index.
sourcepub fn node_weights_mut(&mut self) -> NodeWeightsMut<'_, N, Ix>ⓘNotable traits for NodeWeightsMut<'a, N, Ix>impl<'a, N, Ix> Iterator for NodeWeightsMut<'a, N, Ix> where
Ix: IndexType, type Item = &'a mut N;
pub fn node_weights_mut(&mut self) -> NodeWeightsMut<'_, N, Ix>ⓘNotable traits for NodeWeightsMut<'a, N, Ix>impl<'a, N, Ix> Iterator for NodeWeightsMut<'a, N, Ix> where
Ix: IndexType, type Item = &'a mut N;
Ix: IndexType, type Item = &'a mut N;
An iterator yielding mutable access to all node weights.
The order in which weights are yielded matches the order of their node indices.
sourcepub fn edge_weight(&self, edge: EdgeIndex<Ix>) -> Option<&E>
pub fn edge_weight(&self, edge: EdgeIndex<Ix>) -> Option<&E>
Borrow the weight from the edge at the given index.
sourcepub fn edge_weight_mut(&mut self, edge: EdgeIndex<Ix>) -> Option<&mut E>
pub fn edge_weight_mut(&mut self, edge: EdgeIndex<Ix>) -> Option<&mut E>
Mutably borrow the weight from the edge at the given index.
sourcepub fn edge_weights_mut(&mut self) -> EdgeWeightsMut<'_, E, Ix>ⓘNotable traits for EdgeWeightsMut<'a, E, Ix>impl<'a, E, Ix> Iterator for EdgeWeightsMut<'a, E, Ix> where
Ix: IndexType, type Item = &'a mut E;
pub fn edge_weights_mut(&mut self) -> EdgeWeightsMut<'_, E, Ix>ⓘNotable traits for EdgeWeightsMut<'a, E, Ix>impl<'a, E, Ix> Iterator for EdgeWeightsMut<'a, E, Ix> where
Ix: IndexType, type Item = &'a mut E;
Ix: IndexType, type Item = &'a mut E;
An iterator yielding mutable access to all edge weights.
The order in which weights are yielded matches the order of their edge indices.
sourcepub fn index_twice_mut<A, B>(
&mut self,
a: A,
b: B
) -> (&mut <DiGraph<N, E, Ix> as Index<A>>::Output, &mut <DiGraph<N, E, Ix> as Index<B>>::Output) where
DiGraph<N, E, Ix>: IndexMut<A> + IndexMut<B>,
A: GraphIndex,
B: GraphIndex,
pub fn index_twice_mut<A, B>(
&mut self,
a: A,
b: B
) -> (&mut <DiGraph<N, E, Ix> as Index<A>>::Output, &mut <DiGraph<N, E, Ix> as Index<B>>::Output) where
DiGraph<N, E, Ix>: IndexMut<A> + IndexMut<B>,
A: GraphIndex,
B: GraphIndex,
Index the Dag
by two indices.
Both indices can be either NodeIndex
s, EdgeIndex
s or a combination of the two.
Panics if the indices are equal or if they are out of bounds.
sourcepub fn remove_node(&mut self, node: NodeIndex<Ix>) -> Option<N>
pub fn remove_node(&mut self, node: NodeIndex<Ix>) -> Option<N>
Remove the node at the given index from the Dag
and return it if it exists.
Note: Calling this may shift (and in turn invalidate) previously returned node indices!
sourcepub fn remove_edge(&mut self, e: EdgeIndex<Ix>) -> Option<E>
pub fn remove_edge(&mut self, e: EdgeIndex<Ix>) -> Option<E>
Remove an edge and return its weight, or None
if it didn’t exist.
Computes in O(e’) time, where e’ is the size of four particular edge lists, for the nodes of e and the nodes of another affected edge.
sourcepub fn parents(&self, child: NodeIndex<Ix>) -> Parents<N, E, Ix>
pub fn parents(&self, child: NodeIndex<Ix>) -> Parents<N, E, Ix>
A Walker type that may be used to step through the parents of the given child node.
Unlike iterator types, Walkers do not require borrowing the internal Graph. This makes them useful for traversing the Graph while still being able to mutably borrow it.
If you require an iterator, use one of the Walker methods for converting this Walker into a similarly behaving Iterator type.
See the Walker trait for more useful methods.
sourcepub fn children(&self, parent: NodeIndex<Ix>) -> Children<N, E, Ix>
pub fn children(&self, parent: NodeIndex<Ix>) -> Children<N, E, Ix>
A “walker” object that may be used to step through the children of the given parent node.
Unlike iterator types, Walkers do not require borrowing the internal Graph. This makes them useful for traversing the Graph while still being able to mutably borrow it.
If you require an iterator, use one of the Walker methods for converting this Walker into a similarly behaving Iterator type.
See the Walker trait for more useful methods.
sourcepub fn recursive_walk<F>(
&self,
start: NodeIndex<Ix>,
recursive_fn: F
) -> RecursiveWalk<N, E, Ix, F> where
F: FnMut(&Self, NodeIndex<Ix>) -> Option<(EdgeIndex<Ix>, NodeIndex<Ix>)>,
pub fn recursive_walk<F>(
&self,
start: NodeIndex<Ix>,
recursive_fn: F
) -> RecursiveWalk<N, E, Ix, F> where
F: FnMut(&Self, NodeIndex<Ix>) -> Option<(EdgeIndex<Ix>, NodeIndex<Ix>)>,
A Walker type that recursively walks the Dag using the given recursive_fn
.
See the Walker trait for more useful methods.
Trait Implementations
sourceimpl<N, E, Ix> Data for Dag<N, E, Ix> where
Ix: IndexType,
impl<N, E, Ix> Data for Dag<N, E, Ix> where
Ix: IndexType,
type NodeWeight = N
type EdgeWeight = E
sourceimpl<N, E, Ix> DataMap for Dag<N, E, Ix> where
Ix: IndexType,
impl<N, E, Ix> DataMap for Dag<N, E, Ix> where
Ix: IndexType,
fn node_weight(&self, id: Self::NodeId) -> Option<&Self::NodeWeight>
fn edge_weight(&self, id: Self::EdgeId) -> Option<&Self::EdgeWeight>
sourceimpl<N, E, Ix> DataMapMut for Dag<N, E, Ix> where
Ix: IndexType,
impl<N, E, Ix> DataMapMut for Dag<N, E, Ix> where
Ix: IndexType,
fn node_weight_mut(&mut self, id: Self::NodeId) -> Option<&mut Self::NodeWeight>
fn edge_weight_mut(&mut self, id: Self::EdgeId) -> Option<&mut Self::EdgeWeight>
sourceimpl<'de, N, E, Ix> Deserialize<'de> for Dag<N, E, Ix> where
Self: Sized,
N: Deserialize<'de>,
E: Deserialize<'de>,
Ix: IndexType + Deserialize<'de>,
impl<'de, N, E, Ix> Deserialize<'de> for Dag<N, E, Ix> where
Self: Sized,
N: Deserialize<'de>,
E: Deserialize<'de>,
Ix: IndexType + Deserialize<'de>,
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<N, E, Ix> GetAdjacencyMatrix for Dag<N, E, Ix> where
Ix: IndexType,
impl<N, E, Ix> GetAdjacencyMatrix for Dag<N, E, Ix> where
Ix: IndexType,
type AdjMatrix = <Graph<N, E, Directed, Ix> as GetAdjacencyMatrix>::AdjMatrix
type AdjMatrix = <Graph<N, E, Directed, Ix> as GetAdjacencyMatrix>::AdjMatrix
The associated adjacency matrix type
sourcefn adjacency_matrix(&self) -> Self::AdjMatrix
fn adjacency_matrix(&self) -> Self::AdjMatrix
Create the adjacency matrix
sourceimpl<N, E, Ix> GraphProp for Dag<N, E, Ix> where
Ix: IndexType,
impl<N, E, Ix> GraphProp for Dag<N, E, Ix> where
Ix: IndexType,
fn is_directed(&self) -> bool
sourceimpl<'a, N, E, Ix> IntoEdgeReferences for &'a Dag<N, E, Ix> where
Ix: IndexType,
impl<'a, N, E, Ix> IntoEdgeReferences for &'a Dag<N, E, Ix> where
Ix: IndexType,
type EdgeRef = EdgeReference<'a, E, Ix>
type EdgeReferences = EdgeReferences<'a, E, Ix>
fn edge_references(self) -> Self::EdgeReferences
sourceimpl<'a, N, E, Ix> IntoEdgesDirected for &'a Dag<N, E, Ix> where
Ix: IndexType,
impl<'a, N, E, Ix> IntoEdgesDirected for &'a Dag<N, E, Ix> where
Ix: IndexType,
type EdgesDirected = Edges<'a, E, Directed, Ix>
fn edges_directed(self, a: Self::NodeId, dir: Direction) -> Self::EdgesDirected
sourceimpl<'a, N, E, Ix> IntoNeighbors for &'a Dag<N, E, Ix> where
Ix: IndexType,
impl<'a, N, E, Ix> IntoNeighbors for &'a Dag<N, E, Ix> where
Ix: IndexType,
sourceimpl<'a, N, E, Ix> IntoNeighborsDirected for &'a Dag<N, E, Ix> where
Ix: IndexType,
impl<'a, N, E, Ix> IntoNeighborsDirected for &'a Dag<N, E, Ix> where
Ix: IndexType,
type NeighborsDirected = Neighbors<'a, E, Ix>
fn neighbors_directed(self, n: NodeIndex<Ix>, d: Direction) -> Self::Neighbors
sourceimpl<'a, N, E, Ix> IntoNodeIdentifiers for &'a Dag<N, E, Ix> where
Ix: IndexType,
impl<'a, N, E, Ix> IntoNodeIdentifiers for &'a Dag<N, E, Ix> where
Ix: IndexType,
type NodeIdentifiers = NodeIndices<Ix>
fn node_identifiers(self) -> Self::NodeIdentifiers
sourceimpl<'a, N, E, Ix> IntoNodeReferences for &'a Dag<N, E, Ix> where
Ix: IndexType,
impl<'a, N, E, Ix> IntoNodeReferences for &'a Dag<N, E, Ix> where
Ix: IndexType,
type NodeRef = (NodeIndex<Ix>, &'a N)
type NodeReferences = NodeReferences<'a, N, Ix>
fn node_references(self) -> Self::NodeReferences
sourceimpl<N, E, Ix> NodeCount for Dag<N, E, Ix> where
Ix: IndexType,
impl<N, E, Ix> NodeCount for Dag<N, E, Ix> where
Ix: IndexType,
fn node_count(&self) -> usize
sourceimpl<N, E, Ix> NodeIndexable for Dag<N, E, Ix> where
Ix: IndexType,
impl<N, E, Ix> NodeIndexable for Dag<N, E, Ix> where
Ix: IndexType,
sourcefn node_bound(&self) -> usize
fn node_bound(&self) -> usize
Return an upper bound of the node indices in the graph (suitable for the size of a bitmap). Read more
sourcefn from_index(&self, ix: usize) -> Self::NodeId
fn from_index(&self, ix: usize) -> Self::NodeId
Convert i
to a node index. i
must be a valid value in the graph.
sourceimpl<N, E, Ix> Serialize for Dag<N, E, Ix> where
N: Serialize,
E: Serialize,
Ix: IndexType + Serialize,
impl<N, E, Ix> Serialize for Dag<N, E, Ix> where
N: Serialize,
E: Serialize,
Ix: IndexType + Serialize,
impl<N, E, Ix> NodeCompactIndexable for Dag<N, E, Ix> where
Ix: IndexType,
Auto Trait Implementations
impl<N, E, Ix> RefUnwindSafe for Dag<N, E, Ix> where
E: RefUnwindSafe,
Ix: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, E, Ix> Send for Dag<N, E, Ix> where
E: Send,
Ix: Send,
N: Send,
impl<N, E, Ix> Sync for Dag<N, E, Ix> where
E: Sync,
Ix: Sync,
N: Sync,
impl<N, E, Ix> Unpin for Dag<N, E, Ix> where
E: Unpin,
Ix: Unpin,
N: Unpin,
impl<N, E, Ix> UnwindSafe for Dag<N, E, Ix> where
E: UnwindSafe,
Ix: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more