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

Method run

crates/sats/src/buffer.rs:333–338  ·  view source on GitHub ↗

Run `work` on `writer`, but also count the number of bytes written.

(writer: W, work: impl FnOnce(&mut TeeWriter<W, CountWriter>) -> R)

Source from the content-addressed store, hash-verified

331impl CountWriter {
332 /// Run `work` on `writer`, but also count the number of bytes written.
333 pub fn run<W: BufWriter, R>(writer: W, work: impl FnOnce(&mut TeeWriter<W, CountWriter>) -> R) -> (R, usize) {
334 let counter = Self::default();
335 let mut writer = TeeWriter::new(writer, counter);
336 let ret = work(&mut writer);
337 (ret, writer.w2.finish())
338 }
339
340 /// Consumes the counter and returns the final count.
341 pub fn finish(self) -> usize {

Callers 15

get_all_crate_metadataFunction · 0.45
AppFunction · 0.45
run_all_clap_subcommandsFunction · 0.45
run_publish_checksFunction · 0.45
run_typescript_testsFunction · 0.45
run_docs_buildFunction · 0.45
mainFunction · 0.45
run_smoketestFunction · 0.45
regen_dllsFunction · 0.45
mainFunction · 0.45
ensureSchemaFunction · 0.45

Calls 2

newFunction · 0.50
finishMethod · 0.45

Tested by 15

run_smoketestFunction · 0.36
event_tableFunction · 0.36
multiple_eventsFunction · 0.36
events_dont_persistFunction · 0.36
insert_playerFunction · 0.36
insert_personFunction · 0.36
ban_playerFunction · 0.36
query_builder_filterFunction · 0.36