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 ointer
s and enum ointers
and managing them.
Re-exports
pub use boxed::*;
Modules
- This module defines
ointer
s that wrapsBox
, namedBBox
(called byte stolenBox
) andOBox
(called orientableBox
, with 1 bit stolen). - This module defines
ointer
s that wrapsRc/Weak
, namedBRc/BWeak
(called byte stolenRc/Weak
) andORc/OWeak
(called orientableRc/Weak
, with 1 bit stolen). - This module defines
ointer
s that wrapsArc/Weak
, namedBArc/BWeak
(called byte stolenArc/Weak
) andOArc/OWeak
(called orientableArc/Weak
, with 1 bit stolen).
Macros
- Macro used to define custom enum
ointer
s with the same size ofusize
. - Macro used to define
Weak
likeointer
s. - Macro used to define
Box
/Rc
/Arc
likeointer
s. This crate definesBBox
(called byte stolenBox
) that wrapsBox
and steal high 8-bits(1-byte), by usingdefine_ointer_strong!(BBox, Box, 8);
And defineOBox
(called orientableBox
) by usingdefine_ointer_strong!(OBox, Box, 1);
- Macro used to define
Rc/Weak
orArc/Weak
like sharedointer
s. This crate definesBRc/BWeak
(called byte stolenRc/Weak
) that wrapsRc/Weak
and 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);
Traits
Type Aliases
- Type alias for
sync::OWeak
- Type alias for
rc::ORc
- Type alias for
rc::OWeak
- Type alias for
sync::OArc
- Type alias for
boxed::OBox