Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ get_vertex
Method
get_vertex
publication/code/chapter09/graph_adjlist.rs:95–101 ·
view source on GitHub ↗
(&self, key: &T)
Source
from the content-addressed store, hash-verified
93
}
94
95
fn get_vertex(&self, key: &T) -> Option<&Vertex<T>> {
96
if let Some(vertex) = self.vertices.get(key) {
97
Some(&vertex)
98
} else {
99
None
100
}
101
}
102
103
// 获取所有节点的 key
104
fn vertex_keys(&self) -> Vec<T> {
Callers
1
main
Function · 0.45
Calls
1
get
Method · 0.45
Tested by
no test coverage detected