Expand description
This crate provides a set of traits and macros to enable the creation of custom pointers in Rust, allowing for the storage of extra information in the high bits of a pointer. This extra information can be of various types, and the crate provides utilities for working with these custom pointers efficiently. The crate also offers convenient macros for defining custom ointers and enum ointers and managing them.
Re-exports§
pub use boxed::*;
Modules§
- boxed
- This module defines
ointers that wrapsBox, namedBBox(called byte stolenBox) andOBox(called orientableBox, with 1 bit stolen). - rc
- This module defines
ointers that wrapsRc/Weak, namedBRc/BWeak(called byte stolenRc/Weak) andORc/OWeak(called orientableRc/Weak, with 1 bit stolen). - sync
- This module defines
ointers that wrapsArc/Weak, namedBArc/BWeak(called byte stolenArc/Weak) andOArc/OWeak(called orientableArc/Weak, with 1 bit stolen).
Macros§
- define_
enum_ ointers - Macro used to define custom enum
ointers with the same size ofusize. - define_
ointer - Macro used to define
Weaklikeointers. - define_
ointer_ strong - Macro used to define
Box/Rc/Arclikeointers. This crate definesBBox(called byte stolenBox) that wrapsBoxand steal high 8-bits(1-byte), by usingdefine_ointer_strong!(BBox, Box, 8);And defineOBox(called orientableBox) by usingdefine_ointer_strong!(OBox, Box, 1); - define_
shared_ ointer - Macro used to define
Rc/WeakorArc/Weaklike sharedointers. This crate definesBRc/BWeak(called byte stolenRc/Weak) that wrapsRc/Weakand steal high 8-bits(1-byte), by usingdefine_shared_ointer!(BRc, Rc, BWeak, Weak, 8);And defineORc/OWeak(called orientableRc/Weak) by usingdefine_shared_ointer!(ORc, Rc, OWeak, Weak, 1);