Skip to content

⚠️ A version of std::io::Error implemented on top of Arc instead of Box, making it cloneable

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

spinda/arc-io-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

⚠️ A version of std::io::Error implemented on top of Arc instead of Box, making it cloneable

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages