Open the global monitor mmap for reading.
()
| 180 | impl MmapReader { |
| 181 | /// Open the global monitor mmap for reading. |
| 182 | pub fn open() -> std::io::Result<Self> { |
| 183 | let dir = global_tracedecay_dir().ok_or_else(|| { |
| 184 | std::io::Error::new( |
| 185 | std::io::ErrorKind::NotFound, |
| 186 | "cannot resolve home directory", |
| 187 | ) |
| 188 | })?; |
| 189 | Self::open_at(&dir) |
| 190 | } |
| 191 | |
| 192 | /// Open a monitor mmap at an explicit directory (for testing). |
| 193 | pub fn open_at(dir: &Path) -> std::io::Result<Self> { |