- It’s useful to be able to model an integral type such as
u32as being a series of bits, instead of a whole number. There are, of course, the usual bitwise operators for simple stuff, but the
Bitmaptrait provides more complex, specific operations that are useful for bitmaps.
- A copy of the
downcast-rslibrary, but that has been made
- This module includes some macros for more easily working with pinned types. It takes inspiration from the
pin-utilscrate, but extends it to provide custom visibility on the created methods.
- This macro should be called at the beginning of functions that create logic errors if they are called more than once. Most commonly this is used for initialization functions.
- Adds downcasting support to traits that extend
downcast::Downcastby defining forwarding methods to the corresponding implementations on
std::any::Anyin the standard library.
- A pinned projection of a struct field.
- An unpinned projection of a struct field.
- Values can be wrapped in this type when they’re printed to display them as easy-to-read binary numbers.
Displayis implemented to print the value in the form
Debugwill print it in the form
00000000(8)-00000000(0)(with offsets of each byte).
- A guard for when you want to store some data in a static, and explicitly initialize it at some point. This is different from
spin::Oncein that you do not need to provide an initialization method every time you access the object (it also uses
Option). This will only release shared references to the data inside, so if you want to mutate it from mutable threads, you’ll need to use a type like