MCPcopy Create free account
hub / github.com/hashintel/hash / finish

Method finish

libs/error-stack/src/sink.rs:280–283  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 ///

Callers 8

run_benchmark_seed_groupFunction · 0.45
add_singleFunction · 0.45
add_multipleFunction · 0.45
capture_singleFunction · 0.45
capture_multipleFunction · 0.45
finishFunction · 0.45
finish_okFunction · 0.45
fmtMethod · 0.45

Calls 2

OkInterface · 0.85
defuseMethod · 0.80

Tested by 6

add_singleFunction · 0.36
add_multipleFunction · 0.36
capture_singleFunction · 0.36
capture_multipleFunction · 0.36
finishFunction · 0.36
finish_okFunction · 0.36