borrow-bag

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

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
Download history 549/week @ 2024-06-15 585/week @ 2024-06-22 363/week @ 2024-06-29 575/week @ 2024-07-06 584/week @ 2024-07-13 674/week @ 2024-07-20 604/week @ 2024-07-27 740/week @ 2024-08-03 751/week @ 2024-08-10 571/week @ 2024-08-17 627/week @ 2024-08-24 929/week @ 2024-08-31 586/week @ 2024-09-07 600/week @ 2024-09-14 868/week @ 2024-09-21 815/week @ 2024-09-28

2,973 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