Skip to main content

Crate ad_hoc_result

Crate ad_hoc_result 

Source
Expand description

§Ad Hoc Result

A library providing an extension to Rust’s standard Result type that allows for “ad hoc” values to be provided alongside errors.

This is useful in scenarios where a computation may fail but can still recommend a reasonable value to use despite the failure.
For example, this is needed when you can solve a linear system, but the accuracy is poor due to large condition numbers: you may want to return the computed solution as a recommendation, even though the operation is technically a failure. This is an interface to recommend a value anyway when computation fails.

Enums§

AdHocResult
An enum representing either success (Ok), failure with a recommended value (AdHoc), or complete failure (Err).