Crate poplar_util

source ·


  • It’s useful to be able to model an integral type such as u32 as being a series of bits, instead of a whole number. There are, of course, the usual bitwise operators for simple stuff, but the Bitmap trait provides more complex, specific operations that are useful for bitmaps.
  • This module includes some macros for more easily working with pinned types. It takes inspiration from the pin-utils crate, 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.
  • 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. Display is implemented to print the value in the form 00000000-00000000, while Debug will 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::Once in that you do not need to provide an initialization method every time you access the object (it also uses MaybeUninit instead of 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 Mutex or RwLock within this.