Current write index (number of entries ever written).
(&self)
| 202 | |
| 203 | /// Current write index (number of entries ever written). |
| 204 | pub fn write_idx(&self) -> u64 { |
| 205 | if self.mmap.len() < HEADER_SIZE { |
| 206 | return 0; |
| 207 | } |
| 208 | u64::from_le_bytes( |
| 209 | self.mmap[OFF_WRITE_IDX..OFF_WRITE_IDX + 8] |
| 210 | .try_into() |
| 211 | .unwrap_or([0; 8]), |
| 212 | ) |
| 213 | } |
| 214 | |
| 215 | /// Read the entry at the given ring-buffer slot (0..255). |
| 216 | pub fn entry(&self, slot: usize) -> Option<MonitorEntry> { |
no outgoing calls
no test coverage detected