Finishes the sink and returns a [`Result`]. This method consumes the sink, and returns `Ok(())` if no errors were collected, or `Err(Report<[C]>)` containing all collected errors otherwise. # Examples ``` # use error_stack::ReportSink; # use std::io; let mut sink = ReportSink::new(); # // needed for type inference # sink.capture(io::Error::new(io::ErrorKind::Other, "I/O error")); // ... add err
(mut self)
| 278 | /// # let _result = result; |
| 279 | /// ``` |
| 280 | pub fn finish(mut self) -> Result<(), Report<[C]>> { |
| 281 | self.bomb.defuse(); |
| 282 | self.report.map_or(Ok(()), Err) |
| 283 | } |
| 284 | |
| 285 | /// Finishes the sink and returns a [`Result`] with a custom success value. |
| 286 | /// |