arc-io-error

Crates.ioarc-io-error
lib.rsarc-io-error
version0.1.1
sourcesrc
created_at2017-08-10 23:25:39.85825
updated_at2017-08-11 17:14:43.992967
descriptionA version of std::io::Error implemented on top of Arc instead of Box, making it cloneable.
homepagehttps://github.com/spinda/arc-io-error
repositoryhttps://github.com/spinda/arc-io-error
max_upload_size
id27116
size31,760
Michael Smith (spinda)

documentation

https://docs.rs/arc-io-error/0.1.1

README

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.

Commit count: 13

cargo fmt