diff options
Diffstat (limited to 'src/swarm/throughput.rs')
| -rw-r--r-- | src/swarm/throughput.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/swarm/throughput.rs b/src/swarm/throughput.rs index ec50693..c9bf7ee 100644 --- a/src/swarm/throughput.rs +++ b/src/swarm/throughput.rs @@ -130,6 +130,12 @@ impl ThroughputTable { pub(crate) fn retain(&mut self, mut keep: impl FnMut(&str) -> bool) { self.peers.retain(|peer, _| keep(peer)); } + + /// How many peers it holds an estimate of. + #[cfg(test)] + pub(crate) fn len(&self) -> usize { + self.peers.len() + } } #[cfg(test)] |
