MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / try_push

Function try_push

src/local_logger/rolling_buffer/mod.rs:22–30  ·  view source on GitHub ↗

Push command output into the active rolling buffer. Returns `false` when no buffer is active so the caller can fall back to plain output.

(text: &str)

Source from the content-addressed store, hash-verified

20/// Returns `false` when no buffer is active so the caller can fall back to
21/// plain output.
22pub(super) fn try_push(text: &str) -> bool {
23 if let Ok(mut guard) = ACTIVE_BUFFER.lock()
24 && let Some(rb) = guard.as_mut()
25 {
26 rb.push_lines(text);
27 return true;
28 }
29 false
30}
31
32struct RollingBuffer {
33 lines: VecDeque<String>,

Callers 1

write_command_outputFunction · 0.85

Calls 1

push_linesMethod · 0.80

Tested by

no test coverage detected