other-error 0.1.1

Small wrapper for sharing or combining errors
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented0 out of 0 items with examples
  • Size
  • Source code size: 23.33 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 626.63 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • dariusc93/other-error
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dariusc93

other-error

Lightweight no-std compatible wrapper types for sharing (via Arc or Rc) and combining errors.

Usage

use other_error::{ArcError, EitherError};
use either::Either;

// Make a non-Clone error cheaply cloneable and shareable.
let err = ArcError::new(std::io::Error::other("boom"));
let also_err = err.clone(); // shares the same allocation

// Represent a value that may fail in one of two ways.
let either: EitherError<std::io::Error, std::fmt::Error> =
    Either::Left(std::io::Error::other("boom")).into();
println!("{either}");

MSRV

The minimum supported rust version is 1.81, which can be changed in the future. There is no guarantee that this library will work on older versions of rust.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.