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)
| 20 | /// Returns `false` when no buffer is active so the caller can fall back to |
| 21 | /// plain output. |
| 22 | pub(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 | |
| 32 | struct RollingBuffer { |
| 33 | lines: VecDeque<String>, |
no test coverage detected