arc-io-error 0.1.1

A version of std::io::Error implemented on top of Arc instead of Box, making it cloneable.
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented0 out of 8 items with examples
  • Size
  • Source code size: 31.39 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.96 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • spinda/arc-io-error
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • spinda

arc-io-error

This library provides the IoError type, a version of std::io::Error implemented on top of Arc instead of Box, making it cloneable.

Crates.io Linux/OSX Build Status Windows Build Status

Documentation

Usage

First, add this to your Cargo.toml:

[dependencies]
arc-io-error = "0.1.1"

Next, add this to your crate:

extern crate arc_io_error;

use arc_io_error::IoError;

Overview

The API of IoError has been designed to match io::Error, with two exceptions:

IoError implements From for io::Error and vice-versa, so the two types can easily be converted between each other. A type containing io::Error can be made Clone-compatible by instead storing IoError internally and converting from/to io::Error on API boundaries.

Clones derived from the same original IoError instance will share a single heap-allocated error instance (if one is present) using Arc. io::Error instances produced by converting those clones back with the From implementation will also share the same single error instance.

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.