202 lines
118 KiB
HTML
202 lines
118 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="`MatrixGraph<N, E, Ty, Null>` is a graph datastructure using an adjacency matrix representation."><title>MatrixGraph in petgraph::matrix_graph - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="petgraph" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../petgraph/index.html">petgraph</a><span class="version">0.6.5</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Matrix<wbr>Graph</a></h2><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.add_edge" title="add_edge">add_edge</a></li><li><a href="#method.add_node" title="add_node">add_node</a></li><li><a href="#method.clear" title="clear">clear</a></li><li><a href="#method.edge_count" title="edge_count">edge_count</a></li><li><a href="#method.edge_weight" title="edge_weight">edge_weight</a></li><li><a href="#method.edge_weight_mut" title="edge_weight_mut">edge_weight_mut</a></li><li><a href="#method.edges" title="edges">edges</a></li><li><a href="#method.edges_directed" title="edges_directed">edges_directed</a></li><li><a href="#method.extend_with_edges" title="extend_with_edges">extend_with_edges</a></li><li><a href="#method.from_edges" title="from_edges">from_edges</a></li><li><a href="#method.has_edge" title="has_edge">has_edge</a></li><li><a href="#method.is_directed" title="is_directed">is_directed</a></li><li><a href="#method.neighbors" title="neighbors">neighbors</a></li><li><a href="#method.neighbors_directed" title="neighbors_directed">neighbors_directed</a></li><li><a href="#method.new" title="new">new</a></li><li><a href="#method.new_undirected" title="new_undirected">new_undirected</a></li><li><a href="#method.node_count" title="node_count">node_count</a></li><li><a href="#method.node_weight" title="node_weight">node_weight</a></li><li><a href="#method.node_weight_mut" title="node_weight_mut">node_weight_mut</a></li><li><a href="#method.remove_edge" title="remove_edge">remove_edge</a></li><li><a href="#method.remove_node" title="remove_node">remove_node</a></li><li><a href="#method.update_edge" title="update_edge">update_edge</a></li><li><a href="#method.with_capacity" title="with_capacity">with_capacity</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Build-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Build">Build</a></li><li><a href="#impl-Clone-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Clone">Clone</a></li><li><a href="#impl-Data-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Data">Data</a></li><li><a href="#impl-Default-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Default">Default</a></li><li><a href="#impl-EdgeCount-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="EdgeCount">EdgeCount</a></li><li><a href="#impl-GetAdjacencyMatrix-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="GetAdjacencyMatrix">GetAdjacencyMatrix</a></li><li><a href="#impl-GraphBase-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="GraphBase">GraphBase</a></li><li><a href="#impl-GraphProp-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="GraphProp">GraphProp</a></li><li><a href="#impl-Index%3C(NodeIndex%3CIx%3E,+NodeIndex%3CIx%3E)%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Index<(NodeIndex<Ix>, NodeIndex<Ix>)>">Index<(NodeIndex<Ix>, NodeIndex<Ix>)></a></li><li><a href="#impl-Index%3CNodeIndex%3CIx%3E%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Index<NodeIndex<Ix>>">Index<NodeIndex<Ix>></a></li><li><a href="#impl-IndexMut%3C(NodeIndex%3CIx%3E,+NodeIndex%3CIx%3E)%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="IndexMut<(NodeIndex<Ix>, NodeIndex<Ix>)>">IndexMut<(NodeIndex<Ix>, NodeIndex<Ix>)></a></li><li><a href="#impl-IndexMut%3CNodeIndex%3CIx%3E%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="IndexMut<NodeIndex<Ix>>">IndexMut<NodeIndex<Ix>></a></li><li><a href="#impl-IntoEdgeReferences-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="IntoEdgeReferences">IntoEdgeReferences</a></li><li><a href="#impl-IntoEdges-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="IntoEdges">IntoEdges</a></li><li><a href="#impl-IntoEdgesDirected-for-%26MatrixGraph%3CN,+E,+Directed,+Null,+Ix%3E" title="IntoEdgesDirected">IntoEdgesDirected</a></li><li><a href="#impl-IntoNeighbors-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="IntoNeighbors">IntoNeighbors</a></li><li><a href="#impl-IntoNeighborsDirected-for-%26MatrixGraph%3CN,+E,+Directed,+Null,+Ix%3E" title="IntoNeighborsDirected">IntoNeighborsDirected</a></li><li><a href="#impl-IntoNodeIdentifiers-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="IntoNodeIdentifiers">IntoNodeIdentifiers</a></li><li><a href="#impl-IntoNodeReferences-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="IntoNodeReferences">IntoNodeReferences</a></li><li><a href="#impl-NodeCount-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="NodeCount">NodeCount</a></li><li><a href="#impl-NodeIndexable-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="NodeIndexable">NodeIndexable</a></li><li><a href="#impl-Visitable-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Visitable">Visitable</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" title="UnwindSafe">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-CloneToUninit-for-T" title="CloneToUninit">CloneToUninit</a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-ToOwned-for-T" title="ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In petgraph::<wbr>matrix_<wbr>graph</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">petgraph</a>::<wbr><a href="index.html">matrix_graph</a></span><h1>Struct <span class="struct">MatrixGraph</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/petgraph/matrix_graph.rs.html#208-216">Source</a> </span></div><pre class="rust item-decl"><code>pub struct MatrixGraph<N, E, Ty = <a class="enum" href="../enum.Directed.html" title="enum petgraph::Directed">Directed</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E> = <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><E>, Ix = <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u16.html">u16</a>> { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>MatrixGraph<N, E, Ty, Null></code> is a graph datastructure using an adjacency matrix
|
||
representation.</p>
|
||
<p><code>MatrixGraph</code> is parameterized over:</p>
|
||
<ul>
|
||
<li>Associated data <code>N</code> for nodes and <code>E</code> for edges, called <em>weights</em>.
|
||
The associated data can be of arbitrary type.</li>
|
||
<li>Edge type <code>Ty</code> that determines whether the graph edges are directed or undirected.</li>
|
||
<li>Nullable type <code>Null</code>, which denotes the edges’ presence (defaults to <code>Option<E></code>). You may
|
||
specify <a href="struct.NotZero.html"><code>NotZero<E></code></a> if you want to use a sentinel value (such as 0)
|
||
to mark the absence of an edge.</li>
|
||
<li>Index type <code>Ix</code> that sets the maximum size for the graph (defaults to <code>DefaultIx</code>).</li>
|
||
</ul>
|
||
<p>The graph uses <strong>O(|V^2|)</strong> space, with fast edge insertion & amortized node insertion, as well
|
||
as efficient graph search and graph algorithms on dense graphs.</p>
|
||
<p>This graph is backed by a flattened 2D array. For undirected graphs, only the lower triangular
|
||
matrix is stored. Since the backing array stores edge weights, it is recommended to box large
|
||
edge weights.</p>
|
||
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#224-525">Source</a><a href="#impl-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.with_capacity" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#228-244">Source</a><h4 class="code-header">pub fn <a href="#method.with_capacity" class="fn">with_capacity</a>(node_capacity: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -> Self</h4></section></summary><div class="docblock"><p>Create a new <code>MatrixGraph</code> with estimated capacity for nodes.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.clear" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#260-266">Source</a><h4 class="code-header">pub fn <a href="#method.clear" class="fn">clear</a>(&mut self)</h4></section></summary><div class="docblock"><p>Remove all nodes and edges.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.node_count" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#272-274">Source</a><h4 class="code-header">pub fn <a href="#method.node_count" class="fn">node_count</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Return the number of nodes (vertices) in the graph.</p>
|
||
<p>Computes in <strong>O(1)</strong> time.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.edge_count" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#280-282">Source</a><h4 class="code-header">pub fn <a href="#method.edge_count" class="fn">edge_count</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Return the number of edges in the graph.</p>
|
||
<p>Computes in <strong>O(1)</strong> time.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.is_directed" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#286-288">Source</a><h4 class="code-header">pub fn <a href="#method.is_directed" class="fn">is_directed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return whether the graph has directed edges or not.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_node" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#297-299">Source</a><h4 class="code-header">pub fn <a href="#method.add_node" class="fn">add_node</a>(&mut self, weight: N) -> <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix></h4></section></summary><div class="docblock"><p>Add a node (also called vertex) with associated data <code>weight</code> to the graph.</p>
|
||
<p>Computes in <strong>O(1)</strong> time.</p>
|
||
<p>Return the index of the new node.</p>
|
||
<p><strong>Panics</strong> if the MatrixGraph is at the maximum number of nodes for its index type.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remove_node" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#306-322">Source</a><h4 class="code-header">pub fn <a href="#method.remove_node" class="fn">remove_node</a>(&mut self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> N</h4></section></summary><div class="docblock"><p>Remove <code>a</code> from the graph.</p>
|
||
<p>Computes in <strong>O(V)</strong> time, due to the removal of edges with other nodes.</p>
|
||
<p><strong>Panics</strong> if the node <code>a</code> does not exist.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.update_edge" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#350-358">Source</a><h4 class="code-header">pub fn <a href="#method.update_edge" class="fn">update_edge</a>(
|
||
&mut self,
|
||
a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>,
|
||
b: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>,
|
||
weight: E,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><E></h4></section></summary><div class="docblock"><p>Update the edge from <code>a</code> to <code>b</code> to the graph, with its associated data <code>weight</code>.</p>
|
||
<p>Return the previous data, if any.</p>
|
||
<p>Computes in <strong>O(1)</strong> time, best case.
|
||
Computes in <strong>O(|V|^2)</strong> time, worst case (matrix needs to be re-allocated).</p>
|
||
<p><strong>Panics</strong> if any of the nodes don’t exist.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_edge" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#371-374">Source</a><h4 class="code-header">pub fn <a href="#method.add_edge" class="fn">add_edge</a>(&mut self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>, b: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>, weight: E)</h4></section></summary><div class="docblock"><p>Add an edge from <code>a</code> to <code>b</code> to the graph, with its associated
|
||
data <code>weight</code>.</p>
|
||
<p>Computes in <strong>O(1)</strong> time, best case.
|
||
Computes in <strong>O(|V|^2)</strong> time, worst case (matrix needs to be re-allocated).</p>
|
||
<p><strong>Panics</strong> if any of the nodes don’t exist.
|
||
<strong>Panics</strong> if an edge already exists from <code>a</code> to <code>b</code>.</p>
|
||
<p><strong>Note:</strong> <code>MatrixGraph</code> does not allow adding parallel (“duplicate”) edges. If you want to avoid
|
||
this, use <a href="#method.update_edge"><code>.update_edge(a, b, weight)</code></a> instead.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.remove_edge" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#380-388">Source</a><h4 class="code-header">pub fn <a href="#method.remove_edge" class="fn">remove_edge</a>(&mut self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>, b: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> E</h4></section></summary><div class="docblock"><p>Remove the edge from <code>a</code> to <code>b</code> to the graph.</p>
|
||
<p><strong>Panics</strong> if any of the nodes don’t exist.
|
||
<strong>Panics</strong> if no edge exists between <code>a</code> and <code>b</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_edge" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#393-398">Source</a><h4 class="code-header">pub fn <a href="#method.has_edge" class="fn">has_edge</a>(&self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>, b: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return true if there is an edge between <code>a</code> and <code>b</code>.</p>
|
||
<p><strong>Panics</strong> if any of the nodes don’t exist.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.node_weight" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#405-407">Source</a><h4 class="code-header">pub fn <a href="#method.node_weight" class="fn">node_weight</a>(&self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&N</a></h4></section></summary><div class="docblock"><p>Access the weight for node <code>a</code>.</p>
|
||
<p>Also available with indexing syntax: <code>&graph[a]</code>.</p>
|
||
<p><strong>Panics</strong> if the node doesn’t exist.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.node_weight_mut" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#414-416">Source</a><h4 class="code-header">pub fn <a href="#method.node_weight_mut" class="fn">node_weight_mut</a>(&mut self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&mut N</a></h4></section></summary><div class="docblock"><p>Access the weight for node <code>a</code>, mutably.</p>
|
||
<p>Also available with indexing syntax: <code>&mut graph[a]</code>.</p>
|
||
<p><strong>Panics</strong> if the node doesn’t exist.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.edge_weight" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#423-430">Source</a><h4 class="code-header">pub fn <a href="#method.edge_weight" class="fn">edge_weight</a>(&self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>, b: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&E</a></h4></section></summary><div class="docblock"><p>Access the weight for edge <code>e</code>.</p>
|
||
<p>Also available with indexing syntax: <code>&graph[e]</code>.</p>
|
||
<p><strong>Panics</strong> if no edge exists between <code>a</code> and <code>b</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.edge_weight_mut" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#437-444">Source</a><h4 class="code-header">pub fn <a href="#method.edge_weight_mut" class="fn">edge_weight_mut</a>(&mut self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>, b: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&mut E</a></h4></section></summary><div class="docblock"><p>Access the weight for edge <code>e</code>, mutably.</p>
|
||
<p>Also available with indexing syntax: <code>&mut graph[e]</code>.</p>
|
||
<p><strong>Panics</strong> if no edge exists between <code>a</code> and <code>b</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.neighbors" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#453-459">Source</a><h4 class="code-header">pub fn <a href="#method.neighbors" class="fn">neighbors</a>(&self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> <a class="struct" href="struct.Neighbors.html" title="struct petgraph::matrix_graph::Neighbors">Neighbors</a><'_, Ty, Null, Ix> <a href="#" class="tooltip" data-notable-ty="Neighbors<'_, Ty, Null, Ix>">ⓘ</a></h4></section></summary><div class="docblock"><p>Return an iterator of all nodes with an edge starting from <code>a</code>.</p>
|
||
<ul>
|
||
<li><code>Directed</code>: Outgoing edges from <code>a</code>.</li>
|
||
<li><code>Undirected</code>: All edges from or to <code>a</code>.</li>
|
||
</ul>
|
||
<p>Produces an empty iterator if the node doesn’t exist.<br>
|
||
Iterator element type is <a href="../graph/struct.NodeIndex.html"><code>NodeIndex<Ix></code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.edges" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#468-470">Source</a><h4 class="code-header">pub fn <a href="#method.edges" class="fn">edges</a>(&self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> <a class="struct" href="struct.Edges.html" title="struct petgraph::matrix_graph::Edges">Edges</a><'_, Ty, Null, Ix> <a href="#" class="tooltip" data-notable-ty="Edges<'_, Ty, Null, Ix>">ⓘ</a></h4></section></summary><div class="docblock"><p>Return an iterator of all edges of <code>a</code>.</p>
|
||
<ul>
|
||
<li><code>Directed</code>: Outgoing edges from <code>a</code>.</li>
|
||
<li><code>Undirected</code>: All edges connected to <code>a</code>.</li>
|
||
</ul>
|
||
<p>Produces an empty iterator if the node doesn’t exist.<br>
|
||
Iterator element type is <code>(NodeIndex<Ix>, NodeIndex<Ix>, &E)</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.from_edges" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#489-499">Source</a><h4 class="code-header">pub fn <a href="#method.from_edges" class="fn">from_edges</a><I>(iterable: I) -> Self<div class="where">where
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,
|
||
I::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>: <a class="trait" href="../trait.IntoWeightedEdge.html" title="trait petgraph::IntoWeightedEdge">IntoWeightedEdge</a><E>,
|
||
<I::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a> as <a class="trait" href="../trait.IntoWeightedEdge.html" title="trait petgraph::IntoWeightedEdge">IntoWeightedEdge</a><E>>::<a class="associatedtype" href="../trait.IntoWeightedEdge.html#associatedtype.NodeId" title="type petgraph::IntoWeightedEdge::NodeId">NodeId</a>: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>>,
|
||
N: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,</div></h4></section></summary><div class="docblock"><p>Create a new <code>MatrixGraph</code> from an iterable of edges.</p>
|
||
<p>Node weights <code>N</code> are set to default values.
|
||
Edge weights <code>E</code> may either be specified in the list,
|
||
or they are filled with default values.</p>
|
||
<p>Nodes are inserted automatically to match the edges.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>petgraph::matrix_graph::MatrixGraph;
|
||
|
||
<span class="kw">let </span>gr = MatrixGraph::<(), i32>::from_edges(<span class="kw-2">&</span>[
|
||
(<span class="number">0</span>, <span class="number">1</span>), (<span class="number">0</span>, <span class="number">2</span>), (<span class="number">0</span>, <span class="number">3</span>),
|
||
(<span class="number">1</span>, <span class="number">2</span>), (<span class="number">1</span>, <span class="number">3</span>),
|
||
(<span class="number">2</span>, <span class="number">3</span>),
|
||
]);</code></pre></div>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.extend_with_edges" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#508-524">Source</a><h4 class="code-header">pub fn <a href="#method.extend_with_edges" class="fn">extend_with_edges</a><I>(&mut self, iterable: I)<div class="where">where
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,
|
||
I::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>: <a class="trait" href="../trait.IntoWeightedEdge.html" title="trait petgraph::IntoWeightedEdge">IntoWeightedEdge</a><E>,
|
||
<I::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a> as <a class="trait" href="../trait.IntoWeightedEdge.html" title="trait petgraph::IntoWeightedEdge">IntoWeightedEdge</a><E>>::<a class="associatedtype" href="../trait.IntoWeightedEdge.html#associatedtype.NodeId" title="type petgraph::IntoWeightedEdge::NodeId">NodeId</a>: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>>,
|
||
N: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a>,</div></h4></section></summary><div class="docblock"><p>Extend the graph from an iterable of edges.</p>
|
||
<p>Node weights <code>N</code> are set to default values.
|
||
Edge weights <code>E</code> may either be specified in the list,
|
||
or they are filled with default values.</p>
|
||
<p>Nodes are inserted automatically to match the edges.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-MatrixGraph%3CN,+E,+Directed,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#527-567">Source</a><a href="#impl-MatrixGraph%3CN,+E,+Directed,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, <a class="enum" href="../enum.Directed.html" title="enum petgraph::Directed">Directed</a>, Null, Ix></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.neighbors_directed" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#537-551">Source</a><h4 class="code-header">pub fn <a href="#method.neighbors_directed" class="fn">neighbors_directed</a>(
|
||
&self,
|
||
a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>,
|
||
d: <a class="enum" href="../enum.Direction.html" title="enum petgraph::Direction">Direction</a>,
|
||
) -> <a class="struct" href="struct.Neighbors.html" title="struct petgraph::matrix_graph::Neighbors">Neighbors</a><'_, <a class="enum" href="../enum.Directed.html" title="enum petgraph::Directed">Directed</a>, Null, Ix> <a href="#" class="tooltip" data-notable-ty="Neighbors<'_, Directed, Null, Ix>">ⓘ</a></h4></section></summary><div class="docblock"><p>Return an iterator of all neighbors that have an edge between them and
|
||
<code>a</code>, in the specified direction.
|
||
If the graph’s edges are undirected, this is equivalent to <em>.neighbors(a)</em>.</p>
|
||
<ul>
|
||
<li><code>Outgoing</code>: All edges from <code>a</code>.</li>
|
||
<li><code>Incoming</code>: All edges to <code>a</code>.</li>
|
||
</ul>
|
||
<p>Produces an empty iterator if the node doesn’t exist.<br>
|
||
Iterator element type is <a href="../graph/struct.NodeIndex.html"><code>NodeIndex<Ix></code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.edges_directed" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#560-566">Source</a><h4 class="code-header">pub fn <a href="#method.edges_directed" class="fn">edges_directed</a>(
|
||
&self,
|
||
a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>,
|
||
d: <a class="enum" href="../enum.Direction.html" title="enum petgraph::Direction">Direction</a>,
|
||
) -> <a class="struct" href="struct.Edges.html" title="struct petgraph::matrix_graph::Edges">Edges</a><'_, <a class="enum" href="../enum.Directed.html" title="enum petgraph::Directed">Directed</a>, Null, Ix> <a href="#" class="tooltip" data-notable-ty="Edges<'_, Directed, Null, Ix>">ⓘ</a></h4></section></summary><div class="docblock"><p>Return an iterator of all edges of <code>a</code>, in the specified direction.</p>
|
||
<ul>
|
||
<li><code>Outgoing</code>: All edges from <code>a</code>.</li>
|
||
<li><code>Incoming</code>: All edges to <code>a</code>.</li>
|
||
</ul>
|
||
<p>Produces an empty iterator if the node <code>a</code> doesn’t exist.<br>
|
||
Iterator element type is <code>(NodeIndex<Ix>, NodeIndex<Ix>, &E)</code>.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-MatrixGraph%3CN,+E%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1024-1032">Source</a><a href="#impl-MatrixGraph%3CN,+E%3E" class="anchor">§</a><h3 class="code-header">impl<N, E> <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, <a class="enum" href="../enum.Directed.html" title="enum petgraph::Directed">Directed</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1029-1031">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>() -> Self</h4></section></summary><div class="docblock"><p>Create a new <code>MatrixGraph</code> with directed edges.</p>
|
||
<p>This is a convenience method. Use <code>MatrixGraph::with_capacity</code> or <code>MatrixGraph::default</code> for
|
||
a constructor that is generic in all the type parameters of <code>MatrixGraph</code>.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-MatrixGraph%3CN,+E,+Undirected%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1034-1042">Source</a><a href="#impl-MatrixGraph%3CN,+E,+Undirected%3E" class="anchor">§</a><h3 class="code-header">impl<N, E> <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, <a class="enum" href="../enum.Undirected.html" title="enum petgraph::Undirected">Undirected</a>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new_undirected" class="method"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1039-1041">Source</a><h4 class="code-header">pub fn <a href="#method.new_undirected" class="fn">new_undirected</a>() -> Self</h4></section></summary><div class="docblock"><p>Create a new <code>MatrixGraph</code> with undirected edges.</p>
|
||
<p>This is a convenience method. Use <code>MatrixGraph::with_capacity</code> or <code>MatrixGraph::default</code> for
|
||
a constructor that is generic in all the type parameters of <code>MatrixGraph</code>.</p>
|
||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Build-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1245-1275">Source</a><a href="#impl-Build-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../data/trait.Build.html" title="trait petgraph::data::Build">Build</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><section id="method.add_node-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1248-1250">Source</a><a href="#method.add_node-1" class="anchor">§</a><h4 class="code-header">fn <a href="../data/trait.Build.html#tymethod.add_node" class="fn">add_node</a>(&mut self, weight: Self::<a class="associatedtype" href="../visit/trait.Data.html#associatedtype.NodeWeight" title="type petgraph::visit::Data::NodeWeight">NodeWeight</a>) -> Self::<a class="associatedtype" href="../visit/trait.GraphBase.html#associatedtype.NodeId" title="type petgraph::visit::GraphBase::NodeId">NodeId</a></h4></section><details class="toggle method-toggle" open><summary><section id="method.add_edge-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1252-1264">Source</a><a href="#method.add_edge-1" class="anchor">§</a><h4 class="code-header">fn <a href="../data/trait.Build.html#method.add_edge" class="fn">add_edge</a>(
|
||
&mut self,
|
||
a: Self::<a class="associatedtype" href="../visit/trait.GraphBase.html#associatedtype.NodeId" title="type petgraph::visit::GraphBase::NodeId">NodeId</a>,
|
||
b: Self::<a class="associatedtype" href="../visit/trait.GraphBase.html#associatedtype.NodeId" title="type petgraph::visit::GraphBase::NodeId">NodeId</a>,
|
||
weight: Self::<a class="associatedtype" href="../visit/trait.Data.html#associatedtype.EdgeWeight" title="type petgraph::visit::Data::EdgeWeight">EdgeWeight</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="../visit/trait.GraphBase.html#associatedtype.EdgeId" title="type petgraph::visit::GraphBase::EdgeId">EdgeId</a>></h4></section></summary><div class='docblock'>Add a new edge. If parallel edges (duplicate) are not allowed and
|
||
the edge already exists, return <code>None</code>.</div></details><details class="toggle method-toggle" open><summary><section id="method.update_edge-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1266-1274">Source</a><a href="#method.update_edge-1" class="anchor">§</a><h4 class="code-header">fn <a href="../data/trait.Build.html#tymethod.update_edge" class="fn">update_edge</a>(
|
||
&mut self,
|
||
a: Self::<a class="associatedtype" href="../visit/trait.GraphBase.html#associatedtype.NodeId" title="type petgraph::visit::GraphBase::NodeId">NodeId</a>,
|
||
b: Self::<a class="associatedtype" href="../visit/trait.GraphBase.html#associatedtype.NodeId" title="type petgraph::visit::GraphBase::NodeId">NodeId</a>,
|
||
weight: Self::<a class="associatedtype" href="../visit/trait.Data.html#associatedtype.EdgeWeight" title="type petgraph::visit::Data::EdgeWeight">EdgeWeight</a>,
|
||
) -> Self::<a class="associatedtype" href="../visit/trait.GraphBase.html#associatedtype.EdgeId" title="type petgraph::visit::GraphBase::EdgeId">EdgeId</a></h4></section></summary><div class='docblock'>Add or update the edge from <code>a</code> to <code>b</code>. Return the id of the affected
|
||
edge.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Clone-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#207">Source</a><a href="#impl-Clone-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, E: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, Ty: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, Null: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#207">Source</a><a href="#method.clone" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#tymethod.clone" class="fn">clone</a>(&self) -> <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h4></section></summary><div class='docblock'>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="src" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#174">Source</a></span><a href="#method.clone_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#method.clone_from" class="fn">clone_from</a>(&mut self, source: &Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Data-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1153-1158">Source</a><a href="#impl-Data-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.Data.html" title="trait petgraph::visit::Data">Data</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><section id="associatedtype.NodeWeight" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1156">Source</a><a href="#associatedtype.NodeWeight" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.Data.html#associatedtype.NodeWeight" class="associatedtype">NodeWeight</a> = N</h4></section><section id="associatedtype.EdgeWeight" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1157">Source</a><a href="#associatedtype.EdgeWeight" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.Data.html#associatedtype.EdgeWeight" class="associatedtype">EdgeWeight</a> = E</h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Default-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1016-1022">Source</a><a href="#impl-Default-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="docblock"><p>Create a new empty <code>MatrixGraph</code>.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.default" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1019-1021">Source</a><a href="#method.default" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/default/trait.Default.html#tymethod.default" class="fn">default</a>() -> Self</h4></section></summary><div class='docblock'>Returns the “default value” for a type. <a href="https://doc.rust-lang.org/1.84.0/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-EdgeCount-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1076-1083">Source</a><a href="#impl-EdgeCount-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.EdgeCount.html" title="trait petgraph::visit::EdgeCount">EdgeCount</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.edge_count-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1080-1082">Source</a><a href="#method.edge_count-1" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.EdgeCount.html#tymethod.edge_count" class="fn">edge_count</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Return the number of edges in the graph.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-GetAdjacencyMatrix-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1113-1123">Source</a><a href="#impl-GetAdjacencyMatrix-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.GetAdjacencyMatrix.html" title="trait petgraph::visit::GetAdjacencyMatrix">GetAdjacencyMatrix</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.AdjMatrix" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1116">Source</a><a href="#associatedtype.AdjMatrix" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.GetAdjacencyMatrix.html#associatedtype.AdjMatrix" class="associatedtype">AdjMatrix</a> = <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.unit.html">()</a></h4></section></summary><div class='docblock'>The associated adjacency matrix type</div></details><details class="toggle method-toggle" open><summary><section id="method.adjacency_matrix" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1118">Source</a><a href="#method.adjacency_matrix" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.GetAdjacencyMatrix.html#tymethod.adjacency_matrix" class="fn">adjacency_matrix</a>(&self) -> Self::<a class="associatedtype" href="../visit/trait.GetAdjacencyMatrix.html#associatedtype.AdjMatrix" title="type petgraph::visit::GetAdjacencyMatrix::AdjMatrix">AdjMatrix</a></h4></section></summary><div class='docblock'>Create the adjacency matrix</div></details><details class="toggle method-toggle" open><summary><section id="method.is_adjacent" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1120-1122">Source</a><a href="#method.is_adjacent" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.GetAdjacencyMatrix.html#tymethod.is_adjacent" class="fn">is_adjacent</a>(
|
||
&self,
|
||
_: &Self::<a class="associatedtype" href="../visit/trait.GetAdjacencyMatrix.html#associatedtype.AdjMatrix" title="type petgraph::visit::GetAdjacencyMatrix::AdjMatrix">AdjMatrix</a>,
|
||
a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>,
|
||
b: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>,
|
||
) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'>Return true if there is an edge from <code>a</code> to <code>b</code>, false otherwise. <a href="../visit/trait.GetAdjacencyMatrix.html#tymethod.is_adjacent">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-GraphBase-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1140-1145">Source</a><a href="#impl-GraphBase-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.GraphBase.html" title="trait petgraph::visit::GraphBase">GraphBase</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.NodeId" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1143">Source</a><a href="#associatedtype.NodeId" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.GraphBase.html#associatedtype.NodeId" class="associatedtype">NodeId</a> = <a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix></h4></section></summary><div class='docblock'>node identifier</div></details><details class="toggle" open><summary><section id="associatedtype.EdgeId" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1144">Source</a><a href="#associatedtype.EdgeId" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.GraphBase.html#associatedtype.EdgeId" class="associatedtype">EdgeId</a> = (<a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>, <a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>)</h4></section></summary><div class='docblock'>edge identifier</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-GraphProp-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1147-1151">Source</a><a href="#impl-GraphProp-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.GraphProp.html" title="trait petgraph::visit::GraphProp">GraphProp</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.EdgeType" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1150">Source</a><a href="#associatedtype.EdgeType" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.GraphProp.html#associatedtype.EdgeType" class="associatedtype">EdgeType</a> = Ty</h4></section></summary><div class='docblock'>The kind of edges in the graph.</div></details><section id="method.is_directed-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/visit/mod.rs.html#329-331">Source</a><a href="#method.is_directed-1" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.GraphProp.html#method.is_directed" class="fn">is_directed</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3C(NodeIndex%3CIx%3E,+NodeIndex%3CIx%3E)%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1090-1098">Source</a><a href="#impl-Index%3C(NodeIndex%3CIx%3E,+NodeIndex%3CIx%3E)%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.Index.html" title="trait core::ops::index::Index">Index</a><(<a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>, <a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>)> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="docblock"><p>Index the <code>MatrixGraph</code> by <code>NodeIndex</code> pair to access edge weights.</p>
|
||
<p>Also available with indexing syntax: <code>&graph[e]</code>.</p>
|
||
<p><strong>Panics</strong> if no edge exists between <code>a</code> and <code>b</code>.</p>
|
||
</div><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1093">Source</a><a href="#associatedtype.Output-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = E</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="toggle method-toggle" open><summary><section id="method.index-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1095-1097">Source</a><a href="#method.index-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.Index.html#tymethod.index" class="fn">index</a>(&self, (ax, bx): (<a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>, <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>)) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&E</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Index%3CNodeIndex%3CIx%3E%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1047-1055">Source</a><a href="#impl-Index%3CNodeIndex%3CIx%3E%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.Index.html" title="trait core::ops::index::Index">Index</a><<a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="docblock"><p>Index the <code>MatrixGraph</code> by <code>NodeIndex</code> to access node weights.</p>
|
||
<p><strong>Panics</strong> if the node doesn’t exist.</p>
|
||
</div><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1050">Source</a><a href="#associatedtype.Output" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.Index.html#associatedtype.Output" class="associatedtype">Output</a> = N</h4></section></summary><div class='docblock'>The returned type after indexing.</div></details><details class="toggle method-toggle" open><summary><section id="method.index" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1052-1054">Source</a><a href="#method.index" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.Index.html#tymethod.index" class="fn">index</a>(&self, ax: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&N</a></h4></section></summary><div class='docblock'>Performs the indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.Index.html#tymethod.index">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3C(NodeIndex%3CIx%3E,+NodeIndex%3CIx%3E)%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1105-1111">Source</a><a href="#impl-IndexMut%3C(NodeIndex%3CIx%3E,+NodeIndex%3CIx%3E)%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a><(<a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>, <a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>)> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="docblock"><p>Index the <code>MatrixGraph</code> by <code>NodeIndex</code> pair to access edge weights.</p>
|
||
<p>Also available with indexing syntax: <code>&mut graph[e]</code>.</p>
|
||
<p><strong>Panics</strong> if no edge exists between <code>a</code> and <code>b</code>.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.index_mut-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1108-1110">Source</a><a href="#method.index_mut-1" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&mut self, (ax, bx): (<a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>, <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>)) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&mut E</a></h4></section></summary><div class='docblock'>Performs the mutable indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IndexMut%3CNodeIndex%3CIx%3E%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1060-1066">Source</a><a href="#impl-IndexMut%3CNodeIndex%3CIx%3E%3E-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.IndexMut.html" title="trait core::ops::index::IndexMut">IndexMut</a><<a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="docblock"><p>Index the <code>MatrixGraph</code> by <code>NodeIndex</code> to access node weights.</p>
|
||
<p><strong>Panics</strong> if the node doesn’t exist.</p>
|
||
</div><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.index_mut" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1063-1065">Source</a><a href="#method.index_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut" class="fn">index_mut</a>(&mut self, ax: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&mut N</a></h4></section></summary><div class='docblock'>Performs the mutable indexing (<code>container[index]</code>) operation. <a href="https://doc.rust-lang.org/1.84.0/core/ops/index/trait.IndexMut.html#tymethod.index_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoEdgeReferences-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1200-1208">Source</a><a href="#impl-IntoEdgeReferences-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<'a, N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.IntoEdgeReferences.html" title="trait petgraph::visit::IntoEdgeReferences">IntoEdgeReferences</a> for &'a <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><section id="associatedtype.EdgeRef" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1203">Source</a><a href="#associatedtype.EdgeRef" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.IntoEdgeReferences.html#associatedtype.EdgeRef" class="associatedtype">EdgeRef</a> = (<a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>, <a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>, <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&'a E</a>)</h4></section><section id="associatedtype.EdgeReferences" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1204">Source</a><a href="#associatedtype.EdgeReferences" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.IntoEdgeReferences.html#associatedtype.EdgeReferences" class="associatedtype">EdgeReferences</a> = <a class="struct" href="struct.EdgeReferences.html" title="struct petgraph::matrix_graph::EdgeReferences">EdgeReferences</a><'a, Ty, Null, Ix></h4></section><section id="method.edge_references" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1205-1207">Source</a><a href="#method.edge_references" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.IntoEdgeReferences.html#tymethod.edge_references" class="fn">edge_references</a>(self) -> Self::<a class="associatedtype" href="../visit/trait.IntoEdgeReferences.html#associatedtype.EdgeReferences" title="type petgraph::visit::IntoEdgeReferences::EdgeReferences">EdgeReferences</a></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoEdges-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1210-1217">Source</a><a href="#impl-IntoEdges-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<'a, N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.IntoEdges.html" title="trait petgraph::visit::IntoEdges">IntoEdges</a> for &'a <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><section id="associatedtype.Edges" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1213">Source</a><a href="#associatedtype.Edges" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.IntoEdges.html#associatedtype.Edges" class="associatedtype">Edges</a> = <a class="struct" href="struct.Edges.html" title="struct petgraph::matrix_graph::Edges">Edges</a><'a, Ty, Null, Ix></h4></section><section id="method.edges-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1214-1216">Source</a><a href="#method.edges-1" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.IntoEdges.html#tymethod.edges" class="fn">edges</a>(self, a: Self::<a class="associatedtype" href="../visit/trait.GraphBase.html#associatedtype.NodeId" title="type petgraph::visit::GraphBase::NodeId">NodeId</a>) -> Self::<a class="associatedtype" href="../visit/trait.IntoEdges.html#associatedtype.Edges" title="type petgraph::visit::IntoEdges::Edges">Edges</a></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoEdgesDirected-for-%26MatrixGraph%3CN,+E,+Directed,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1219-1227">Source</a><a href="#impl-IntoEdgesDirected-for-%26MatrixGraph%3CN,+E,+Directed,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<'a, N, E, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.IntoEdgesDirected.html" title="trait petgraph::visit::IntoEdgesDirected">IntoEdgesDirected</a> for &'a <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, <a class="enum" href="../enum.Directed.html" title="enum petgraph::Directed">Directed</a>, Null, Ix></h3></section></summary><div class="impl-items"><section id="associatedtype.EdgesDirected" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1222">Source</a><a href="#associatedtype.EdgesDirected" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.IntoEdgesDirected.html#associatedtype.EdgesDirected" class="associatedtype">EdgesDirected</a> = <a class="struct" href="struct.Edges.html" title="struct petgraph::matrix_graph::Edges">Edges</a><'a, <a class="enum" href="../enum.Directed.html" title="enum petgraph::Directed">Directed</a>, Null, Ix></h4></section><section id="method.edges_directed-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1224-1226">Source</a><a href="#method.edges_directed-1" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.IntoEdgesDirected.html#tymethod.edges_directed" class="fn">edges_directed</a>(self, a: Self::<a class="associatedtype" href="../visit/trait.GraphBase.html#associatedtype.NodeId" title="type petgraph::visit::GraphBase::NodeId">NodeId</a>, dir: <a class="enum" href="../enum.Direction.html" title="enum petgraph::Direction">Direction</a>) -> Self::<a class="associatedtype" href="../visit/trait.IntoEdgesDirected.html#associatedtype.EdgesDirected" title="type petgraph::visit::IntoEdgesDirected::EdgesDirected">EdgesDirected</a></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoNeighbors-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1170-1178">Source</a><a href="#impl-IntoNeighbors-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<'a, N, E: 'a, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.IntoNeighbors.html" title="trait petgraph::visit::IntoNeighbors">IntoNeighbors</a> for &'a <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><section id="associatedtype.Neighbors" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1173">Source</a><a href="#associatedtype.Neighbors" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.IntoNeighbors.html#associatedtype.Neighbors" class="associatedtype">Neighbors</a> = <a class="struct" href="struct.Neighbors.html" title="struct petgraph::matrix_graph::Neighbors">Neighbors</a><'a, Ty, Null, Ix></h4></section><details class="toggle method-toggle" open><summary><section id="method.neighbors-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1175-1177">Source</a><a href="#method.neighbors-1" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.IntoNeighbors.html#tymethod.neighbors" class="fn">neighbors</a>(self, a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> Self::<a class="associatedtype" href="../visit/trait.IntoNeighbors.html#associatedtype.Neighbors" title="type petgraph::visit::IntoNeighbors::Neighbors">Neighbors</a></h4></section></summary><div class='docblock'>Return an iterator of the neighbors of node <code>a</code>.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoNeighborsDirected-for-%26MatrixGraph%3CN,+E,+Directed,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1180-1188">Source</a><a href="#impl-IntoNeighborsDirected-for-%26MatrixGraph%3CN,+E,+Directed,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<'a, N, E: 'a, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.IntoNeighborsDirected.html" title="trait petgraph::visit::IntoNeighborsDirected">IntoNeighborsDirected</a> for &'a <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, <a class="enum" href="../enum.Directed.html" title="enum petgraph::Directed">Directed</a>, Null, Ix></h3></section></summary><div class="impl-items"><section id="associatedtype.NeighborsDirected" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1183">Source</a><a href="#associatedtype.NeighborsDirected" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.IntoNeighborsDirected.html#associatedtype.NeighborsDirected" class="associatedtype">NeighborsDirected</a> = <a class="struct" href="struct.Neighbors.html" title="struct petgraph::matrix_graph::Neighbors">Neighbors</a><'a, <a class="enum" href="../enum.Directed.html" title="enum petgraph::Directed">Directed</a>, Null, Ix></h4></section><section id="method.neighbors_directed-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1185-1187">Source</a><a href="#method.neighbors_directed-1" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.IntoNeighborsDirected.html#tymethod.neighbors_directed" class="fn">neighbors_directed</a>(
|
||
self,
|
||
a: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>,
|
||
d: <a class="enum" href="../enum.Direction.html" title="enum petgraph::Direction">Direction</a>,
|
||
) -> Self::<a class="associatedtype" href="../visit/trait.IntoNeighborsDirected.html#associatedtype.NeighborsDirected" title="type petgraph::visit::IntoNeighborsDirected::NeighborsDirected">NeighborsDirected</a></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoNodeIdentifiers-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1160-1168">Source</a><a href="#impl-IntoNodeIdentifiers-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<'a, N, E: 'a, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.IntoNodeIdentifiers.html" title="trait petgraph::visit::IntoNodeIdentifiers">IntoNodeIdentifiers</a> for &'a <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><section id="associatedtype.NodeIdentifiers" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1163">Source</a><a href="#associatedtype.NodeIdentifiers" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.IntoNodeIdentifiers.html#associatedtype.NodeIdentifiers" class="associatedtype">NodeIdentifiers</a> = <a class="struct" href="struct.NodeIdentifiers.html" title="struct petgraph::matrix_graph::NodeIdentifiers">NodeIdentifiers</a><'a, Ix></h4></section><section id="method.node_identifiers" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1165-1167">Source</a><a href="#method.node_identifiers" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.IntoNodeIdentifiers.html#tymethod.node_identifiers" class="fn">node_identifiers</a>(self) -> Self::<a class="associatedtype" href="../visit/trait.IntoNodeIdentifiers.html#associatedtype.NodeIdentifiers" title="type petgraph::visit::IntoNodeIdentifiers::NodeIdentifiers">NodeIdentifiers</a></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-IntoNodeReferences-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1190-1198">Source</a><a href="#impl-IntoNodeReferences-for-%26MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<'a, N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.IntoNodeReferences.html" title="trait petgraph::visit::IntoNodeReferences">IntoNodeReferences</a> for &'a <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><section id="associatedtype.NodeRef" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1193">Source</a><a href="#associatedtype.NodeRef" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.IntoNodeReferences.html#associatedtype.NodeRef" class="associatedtype">NodeRef</a> = (<a class="struct" href="../graph/struct.NodeIndex.html" title="struct petgraph::graph::NodeIndex">NodeIndex</a><Ix>, <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&'a N</a>)</h4></section><section id="associatedtype.NodeReferences" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1194">Source</a><a href="#associatedtype.NodeReferences" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.IntoNodeReferences.html#associatedtype.NodeReferences" class="associatedtype">NodeReferences</a> = <a class="struct" href="struct.NodeReferences.html" title="struct petgraph::matrix_graph::NodeReferences">NodeReferences</a><'a, N, Ix></h4></section><section id="method.node_references" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1195-1197">Source</a><a href="#method.node_references" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.IntoNodeReferences.html#tymethod.node_references" class="fn">node_references</a>(self) -> Self::<a class="associatedtype" href="../visit/trait.IntoNodeReferences.html#associatedtype.NodeReferences" title="type petgraph::visit::IntoNodeReferences::NodeReferences">NodeReferences</a></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-NodeCount-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1068-1074">Source</a><a href="#impl-NodeCount-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.NodeCount.html" title="trait petgraph::visit::NodeCount">NodeCount</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><section id="method.node_count-1" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1071-1073">Source</a><a href="#method.node_count-1" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.NodeCount.html#tymethod.node_count" class="fn">node_count</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-NodeIndexable-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1229-1243">Source</a><a href="#impl-NodeIndexable-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.NodeIndexable.html" title="trait petgraph::visit::NodeIndexable">NodeIndexable</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.node_bound" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1232-1234">Source</a><a href="#method.node_bound" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.NodeIndexable.html#tymethod.node_bound" class="fn">node_bound</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Return an upper bound of the node indices in the graph
|
||
(suitable for the size of a bitmap).</div></details><details class="toggle method-toggle" open><summary><section id="method.to_index" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1236-1238">Source</a><a href="#method.to_index" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.NodeIndexable.html#tymethod.to_index" class="fn">to_index</a>(&self, ix: <a class="type" href="type.NodeIndex.html" title="type petgraph::matrix_graph::NodeIndex">NodeIndex</a><Ix>) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'>Convert <code>a</code> to an integer index.</div></details><details class="toggle method-toggle" open><summary><section id="method.from_index" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1240-1242">Source</a><a href="#method.from_index" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.NodeIndexable.html#tymethod.from_index" class="fn">from_index</a>(&self, ix: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>) -> Self::<a class="associatedtype" href="../visit/trait.GraphBase.html#associatedtype.NodeId" title="type petgraph::visit::GraphBase::NodeId">NodeId</a></h4></section></summary><div class='docblock'>Convert <code>i</code> to a node index. <code>i</code> must be a valid value in the graph.</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Visitable-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1125-1138">Source</a><a href="#impl-Visitable-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty: <a class="trait" href="../trait.EdgeType.html" title="trait petgraph::EdgeType">EdgeType</a>, Null: <a class="trait" href="trait.Nullable.html" title="trait petgraph::matrix_graph::Nullable">Nullable</a><Wrapped = E>, Ix: <a class="trait" href="../graph/trait.IndexType.html" title="trait petgraph::graph::IndexType">IndexType</a>> <a class="trait" href="../visit/trait.Visitable.html" title="trait petgraph::visit::Visitable">Visitable</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Map" class="associatedtype trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1128">Source</a><a href="#associatedtype.Map" class="anchor">§</a><h4 class="code-header">type <a href="../visit/trait.Visitable.html#associatedtype.Map" class="associatedtype">Map</a> = <a class="struct" href="../../fixedbitset/struct.FixedBitSet.html" title="struct fixedbitset::FixedBitSet">FixedBitSet</a></h4></section></summary><div class='docblock'>The associated map type</div></details><details class="toggle method-toggle" open><summary><section id="method.visit_map" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1130-1132">Source</a><a href="#method.visit_map" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.Visitable.html#tymethod.visit_map" class="fn">visit_map</a>(&self) -> <a class="struct" href="../../fixedbitset/struct.FixedBitSet.html" title="struct fixedbitset::FixedBitSet">FixedBitSet</a></h4></section></summary><div class='docblock'>Create a new visitor map</div></details><details class="toggle method-toggle" open><summary><section id="method.reset_map" class="method trait-impl"><a class="src rightside" href="../../src/petgraph/matrix_graph.rs.html#1134-1137">Source</a><a href="#method.reset_map" class="anchor">§</a><h4 class="code-header">fn <a href="../visit/trait.Visitable.html#tymethod.reset_map" class="fn">reset_map</a>(&self, map: &mut Self::<a class="associatedtype" href="../visit/trait.Visitable.html#associatedtype.Map" title="type petgraph::visit::Visitable::Map">Map</a>)</h4></section></summary><div class='docblock'>Reset the visitor map (and resize to new size of graph if needed)</div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a href="#impl-Freeze-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty, Null, Ix> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix></h3></section><section id="impl-RefUnwindSafe-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a href="#impl-RefUnwindSafe-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty, Null, Ix> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix><div class="where">where
|
||
Ty: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,
|
||
Ix: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,
|
||
Null: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,
|
||
N: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a>,</div></h3></section><section id="impl-Send-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a href="#impl-Send-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty, Null, Ix> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix><div class="where">where
|
||
Ty: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
|
||
Ix: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
|
||
Null: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,
|
||
N: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,</div></h3></section><section id="impl-Sync-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a href="#impl-Sync-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty, Null, Ix> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix><div class="where">where
|
||
Ty: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
|
||
Ix: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
|
||
Null: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,
|
||
N: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,</div></h3></section><section id="impl-Unpin-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a href="#impl-Unpin-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty, Null, Ix> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix><div class="where">where
|
||
Ty: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
|
||
Ix: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
|
||
Null: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,
|
||
N: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h3></section><section id="impl-UnwindSafe-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="impl"><a href="#impl-UnwindSafe-for-MatrixGraph%3CN,+E,+Ty,+Null,+Ix%3E" class="anchor">§</a><h3 class="code-header">impl<N, E, Ty, Null, Ix> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.MatrixGraph.html" title="struct petgraph::matrix_graph::MatrixGraph">MatrixGraph</a><N, E, Ty, Null, Ix><div class="where">where
|
||
Ty: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,
|
||
Ix: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,
|
||
Null: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,
|
||
N: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a>,</div></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/any.rs.html#138">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
||
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/any.rs.html#139">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.84.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.84.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#209">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#211">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#217">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
||
T: ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/borrow.rs.html#218">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.84.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-CloneToUninit-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#273">Source</a><a href="#impl-CloneToUninit-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html" title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.clone_to_uninit" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/clone.rs.html#275">Source</a><a href="#method.clone_to_uninit" class="anchor">§</a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit" class="fn">clone_to_uninit</a>(&self, dst: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><div class='docblock'>Performs copy-assignment from <code>self</code> to <code>dst</code>. <a href="https://doc.rust-lang.org/1.84.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#765">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#768">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#748-750">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#758">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
||
<p>That is, this conversion is whatever the implementation of
|
||
<code><a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ToOwned-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#82-84">Source</a><a href="#impl-ToOwned-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#86">Source</a><a href="#associatedtype.Owned" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#87">Source</a><a href="#method.to_owned" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fn">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><details class="toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/alloc/borrow.rs.html#91">Source</a><a href="#method.clone_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fn">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.reference.html">&mut T</a>)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.84.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#805-807">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#809">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#812">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#790-792">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
||
U: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#794">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/1.84.0/src/core/convert/mod.rs.html#797">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div><script type="text/json" id="notable-traits-data">{"Edges<'_, Directed, Null, Ix>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Edges.html\" title=\"struct petgraph::matrix_graph::Edges\">Edges</a><'a, Ty, Null, Ix></code></h3><pre><code><div class=\"where\">impl<'a, Ty: <a class=\"trait\" href=\"../trait.EdgeType.html\" title=\"trait petgraph::EdgeType\">EdgeType</a>, Null: <a class=\"trait\" href=\"trait.Nullable.html\" title=\"trait petgraph::matrix_graph::Nullable\">Nullable</a>, Ix: <a class=\"trait\" href=\"../graph/trait.IndexType.html\" title=\"trait petgraph::graph::IndexType\">IndexType</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.Edges.html\" title=\"struct petgraph::matrix_graph::Edges\">Edges</a><'a, Ty, Null, Ix></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = (<a class=\"type\" href=\"type.NodeIndex.html\" title=\"type petgraph::matrix_graph::NodeIndex\">NodeIndex</a><Ix>, <a class=\"type\" href=\"type.NodeIndex.html\" title=\"type petgraph::matrix_graph::NodeIndex\">NodeIndex</a><Ix>, &'a Null::<a class=\"associatedtype\" href=\"trait.Nullable.html#associatedtype.Wrapped\" title=\"type petgraph::matrix_graph::Nullable::Wrapped\">Wrapped</a>);</div>","Edges<'_, Ty, Null, Ix>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Edges.html\" title=\"struct petgraph::matrix_graph::Edges\">Edges</a><'a, Ty, Null, Ix></code></h3><pre><code><div class=\"where\">impl<'a, Ty: <a class=\"trait\" href=\"../trait.EdgeType.html\" title=\"trait petgraph::EdgeType\">EdgeType</a>, Null: <a class=\"trait\" href=\"trait.Nullable.html\" title=\"trait petgraph::matrix_graph::Nullable\">Nullable</a>, Ix: <a class=\"trait\" href=\"../graph/trait.IndexType.html\" title=\"trait petgraph::graph::IndexType\">IndexType</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.Edges.html\" title=\"struct petgraph::matrix_graph::Edges\">Edges</a><'a, Ty, Null, Ix></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = (<a class=\"type\" href=\"type.NodeIndex.html\" title=\"type petgraph::matrix_graph::NodeIndex\">NodeIndex</a><Ix>, <a class=\"type\" href=\"type.NodeIndex.html\" title=\"type petgraph::matrix_graph::NodeIndex\">NodeIndex</a><Ix>, &'a Null::<a class=\"associatedtype\" href=\"trait.Nullable.html#associatedtype.Wrapped\" title=\"type petgraph::matrix_graph::Nullable::Wrapped\">Wrapped</a>);</div>","Neighbors<'_, Directed, Null, Ix>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Neighbors.html\" title=\"struct petgraph::matrix_graph::Neighbors\">Neighbors</a><'a, Ty, Null, Ix></code></h3><pre><code><div class=\"where\">impl<'a, Ty: <a class=\"trait\" href=\"../trait.EdgeType.html\" title=\"trait petgraph::EdgeType\">EdgeType</a>, Null: <a class=\"trait\" href=\"trait.Nullable.html\" title=\"trait petgraph::matrix_graph::Nullable\">Nullable</a>, Ix: <a class=\"trait\" href=\"../graph/trait.IndexType.html\" title=\"trait petgraph::graph::IndexType\">IndexType</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.Neighbors.html\" title=\"struct petgraph::matrix_graph::Neighbors\">Neighbors</a><'a, Ty, Null, Ix></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"type\" href=\"type.NodeIndex.html\" title=\"type petgraph::matrix_graph::NodeIndex\">NodeIndex</a><Ix>;</div>","Neighbors<'_, Ty, Null, Ix>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Neighbors.html\" title=\"struct petgraph::matrix_graph::Neighbors\">Neighbors</a><'a, Ty, Null, Ix></code></h3><pre><code><div class=\"where\">impl<'a, Ty: <a class=\"trait\" href=\"../trait.EdgeType.html\" title=\"trait petgraph::EdgeType\">EdgeType</a>, Null: <a class=\"trait\" href=\"trait.Nullable.html\" title=\"trait petgraph::matrix_graph::Nullable\">Nullable</a>, Ix: <a class=\"trait\" href=\"../graph/trait.IndexType.html\" title=\"trait petgraph::graph::IndexType\">IndexType</a>> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.Neighbors.html\" title=\"struct petgraph::matrix_graph::Neighbors\">Neighbors</a><'a, Ty, Null, Ix></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"type\" href=\"type.NodeIndex.html\" title=\"type petgraph::matrix_graph::NodeIndex\">NodeIndex</a><Ix>;</div>"}</script></section></div></main></body></html> |