Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ add_multi
Method
add_multi
code/chapter09/conshash.rs:51–57 ·
view source on GitHub ↗
批量插入结点
(&mut self, nodes: &[T])
Source
from the content-addressed store, hash-verified
49
50
// 批量插入结点
51
fn add_multi(&mut self, nodes: &[T]) {
52
if !nodes.is_empty() {
53
for node in nodes.iter() {
54
self.add(node);
55
}
56
}
57
}
58
59
fn add(&mut self, node: &T) {
60
for i in 0..self.replicas {
Callers
nothing calls this directly
Calls
3
is_empty
Method · 0.45
iter
Method · 0.45
add
Method · 0.45
Tested by
no test coverage detected