MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / len

Method len

nodedb-bridge/src/buffer.rs:206–210  ·  view source on GitHub ↗

Returns the number of items currently in the queue.

(&self)

Source from the content-addressed store, hash-verified

204
205 /// Returns the number of items currently in the queue.
206 pub fn len(&self) -> usize {
207 let tail = self.shared.tail.value.load(Ordering::Relaxed);
208 let head = self.shared.head.value.load(Ordering::Relaxed);
209 tail.wrapping_sub(head) as usize
210 }
211
212 /// Returns `true` if the queue is empty.
213 pub fn is_empty(&self) -> bool {

Callers 6

is_emptyMethod · 0.45
pop_nextMethod · 0.45
depth_forMethod · 0.45
active_database_countMethod · 0.45
fair_share_slotsMethod · 0.45
tokio_to_tpc_via_eventfdFunction · 0.45

Calls 1

loadMethod · 0.45

Tested by 1

tokio_to_tpc_via_eventfdFunction · 0.36