Fallible Collections.rs
Implements APIs on Rust collections wich gracefully return a Result when an allocation error occurs.
This is inspired a lot by RFC 2116.
There are APIs for a fallible interface for Vec, Box, BTree, HashMap,
and a TryClone trait wich is implemented for primitive Rust traits and a fallible format macro.
You can use this with try_clone_derive crate wich derive TryClone for your own types.
Getting Started
fallible_collections is available on crates.io.
It is recommended to look there for the newest released version, as well as links to the newest builds of the docs.
Add the following dependency to your Cargo manifest:
[]
= "0.5"
# or
= { = "0.5", = ["std"] }
...and see the docs for how to use it.
Example
Exemple of using the FallibleBox interface.
use FallibleBox;
Exemple of using the FallibleVec interface.
use FallibleVec;
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.