#fields #packing #complex #pointers #experimental #type #pointer-sized

nightly no-std viaptr

An experimental library for packing complex types into pointer-sized fields

1 unstable release

new 0.1.0 Apr 19, 2024

#232 in Memory management

Download history 132/week @ 2024-04-15

132 downloads per month

MPL-2.0 license

20KB
548 lines

viaptr

An experimental library for packing complex types into pointer-sized fields.

Examples

Compact<Result<Box<A>, Box<B>>> // A pointer to A or B, taking up only one machine word
Compact<(Box<A>, Bits<2>)> // A tagged pointer with two additional bits of information

TODO

  • document safety constraints on unsafe traits and functions
  • general documentation

License

Mozilla Public License 2.0

Dependencies

~24KB