Crate ointer

Source
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 wraps Box, named BBox(called byte stolen Box) and OBox(called orientable Box, with 1 bit stolen).
rc
This module defines ointers that wraps Rc/Weak, named BRc/BWeak(called byte stolen Rc/Weak) and ORc/OWeak(called orientable Rc/Weak, with 1 bit stolen).
sync
This module defines ointers that wraps Arc/Weak, named BArc/BWeak(called byte stolen Arc/Weak) and OArc/OWeak(called orientable Arc/Weak, with 1 bit stolen).

Macros§

define_enum_ointers
Macro used to define custom enum ointers with the same size of usize.
define_ointer
Macro used to define Weak like ointers.
define_ointer_strong
Macro used to define Box/Rc/Arc like ointers. This crate defines BBox(called byte stolen Box) that wraps Box and steal high 8-bits(1-byte), by using define_ointer_strong!(BBox, Box, 8); And define OBox(called orientable Box) by using define_ointer_strong!(OBox, Box, 1);
define_shared_ointer
Macro used to define Rc/Weak or Arc/Weak like shared ointers. This crate defines BRc/BWeak(called byte stolen Rc/Weak) that wraps Rc/Weak and steal high 8-bits(1-byte), by using define_shared_ointer!(BRc, Rc, BWeak, Weak, 8); And define ORc/OWeak(called orientable Rc/Weak) by using define_shared_ointer!(ORc, Rc, OWeak, Weak, 1);

Traits§

Ointer
OinterGet
OinterSet

Type Aliases§

Oak
Type alias for sync::OWeak
Oc
Type alias for rc::ORc
Ok
Type alias for rc::OWeak
Orc
Type alias for sync::OArc
Ox
Type alias for boxed::OBox