9 releases (3 stable)

Uses old Rust 2015

1.1.1 Sep 12, 2023
1.1.0 Mar 20, 2021
1.0.0 Feb 28, 2018
0.4.0 Nov 4, 2017
0.3.0 May 17, 2017

#1057 in Web programming

Download history 1366/week @ 2023-11-06 1246/week @ 2023-11-13 1119/week @ 2023-11-20 1405/week @ 2023-11-27 803/week @ 2023-12-04 1054/week @ 2023-12-11 829/week @ 2023-12-18 645/week @ 2023-12-25 905/week @ 2024-01-01 1050/week @ 2024-01-08 1051/week @ 2024-01-15 1004/week @ 2024-01-22 1091/week @ 2024-01-29 881/week @ 2024-02-05 1085/week @ 2024-02-12 1091/week @ 2024-02-19

4,180 downloads per month
Used in 25 crates (via gotham)

MIT/Apache

11KB
118 lines

BorrowBag

A type-safe, heterogeneous collection with zero-cost add and borrow.

BorrowBag allows the storage of any value, and returns a Handle which can be used to borrow the value back later. As the BorrowBag is add-only, Handle values remain valid for the lifetime of the BorrowBag.

For usage details, please see the documentation

Motivation

BorrowBag solves the problem of assembling Gotham's Middleware and Pipeline structures, storing concrete types without losing their type information, and with an ability to borrow them back later after moving the collection.

The Gotham project extracted the implementation into this crate for use in other contexts and continues to maintain it.

License

Licensed under your option of:

Community

The following policies guide participation in our project and our community:

No runtime deps