Creates a new recorder which will write to the specified filename.
(filename: &str)
| 91 | impl Recorder { |
| 92 | /// Creates a new recorder which will write to the specified filename. |
| 93 | pub fn new(filename: &str) -> Result<Recorder> { |
| 94 | Ok(Recorder { |
| 95 | file: BufWriter::new( |
| 96 | OpenOptions::new() |
| 97 | .write(true) |
| 98 | .create_new(true) |
| 99 | .open(filename) |
| 100 | .with_context(|| format!("failed to open `{filename}` for writing"))?, |
| 101 | ), |
| 102 | }) |
| 103 | } |
| 104 | |
| 105 | /// Adds a new function that may be sampled in the future. |
| 106 | /// |
nothing calls this directly
no test coverage detected