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

#415 in HTTP server

Download history 737/week @ 2023-12-16 470/week @ 2023-12-23 694/week @ 2023-12-30 918/week @ 2024-01-06 945/week @ 2024-01-13 903/week @ 2024-01-20 950/week @ 2024-01-27 713/week @ 2024-02-03 897/week @ 2024-02-10 877/week @ 2024-02-17 681/week @ 2024-02-24 637/week @ 2024-03-02 1000/week @ 2024-03-09 935/week @ 2024-03-16 779/week @ 2024-03-23 796/week @ 2024-03-30

3,616 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