MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / handle

Method handle

splashsurf/src/logging.rs:23–30  ·  view source on GitHub ↗

Helper function to execute everything before running "inner_function"

(&mut self, inner_function: F)

Source from the content-addressed store, hash-verified

21impl<T: Write + Send> ProgressHandler<T> {
22 /// Helper function to execute everything before running "inner_function"
23 fn handle<F: FnOnce(&mut Self) -> R, R>(&mut self, inner_function: F) -> R {
24 let handle = get_progress_bar();
25
26 match handle {
27 Some(pb) => pb.suspend(|| inner_function(self)),
28 None => inner_function(self),
29 }
30 }
31
32 /// Create a new instance of "Self"
33 pub fn new(pipe: T) -> Self {

Callers 2

writeMethod · 0.80
flushMethod · 0.80

Calls 1

get_progress_barFunction · 0.85

Tested by

no test coverage detected