Expand description
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.
Structs§
- Borrow
Bag BorrowBagallows the storage of any value usingadd(T), and returns aHandlewhich can be used to borrow the value back later. As theBorrowBagis add-only,Handlevalues remain valid for the lifetime of theBorrowBag.- Handle
- A value which can be used with the
BorrowBagto borrow the element which was added.
Traits§
- Append
- Describes the result of appending
Tto the borrow-bag. This is useful in specifying the return type when creating/modifying aBorrowBagin a function. - Lookup
- Allows borrowing a value of type
Tfrom the implementing type. This can be used to constrain aHandleargument to ensure it can be used with the correspondingBorrowBag.