🗂️ resman
Runtime managed resource borrowing.
This library provides a map that can store one of any type, as well as mutable borrows to each type at the same time.
Note: This implementation is extracted from shred, with the following differences:
- Uses
downcast-rsinstead ofmopafor downcasting types. - Adds
DebugandPartialEqimplementations for borrow types when the resource type implements those traits. - Returns
Noneinstead of panicking fortry_borrow*functions when the resource is already borrowed.
Usage
Add the following to Cargo.toml
= "0.1.0"
In code:
use Resources;
;
;
See Also
anymap: Map of any type, without multiple mutable borrows.shred: ContainsResourcestype, plus a task dispatcher.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://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.