MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / take

Method take

crates/data-structures/src/object_pool.rs:101–103  ·  view source on GitHub ↗

Takes an object from the pool or creates a new one.

(&self, clear: impl FnOnce(&mut T), new: impl FnOnce() -> T)

Source from the content-addressed store, hash-verified

99
100 /// Takes an object from the pool or creates a new one.
101 pub fn take(&self, clear: impl FnOnce(&mut T), new: impl FnOnce() -> T) -> T {
102 self.inner.take(clear, new)
103 }
104
105 /// Returns the number of pages dropped by the pool because the pool was at capacity.
106 pub fn dropped_count(&self) -> usize {

Callers 3

takeFunction · 0.45
pool_drops_past_max_sizeFunction · 0.45
closeMethod · 0.45

Calls 4

incFunction · 0.70
newFunction · 0.70
mapMethod · 0.45
heap_usageMethod · 0.45

Tested by 1

pool_drops_past_max_sizeFunction · 0.36