Module cartable_ptr

Source
Expand description

Types for optional pointers with niche optimization.

The main type is CartableOptionPointer, which is like Option<Rc> but with a niche so that the resulting Yoke has a niche. The following four types can be stored in the CartableOptionPointer:

  1. &T
  2. Box<T>
  3. Rc<T>
  4. Arc<T>

These four types implement the sealed unsafe trait CartablePointerLike. In addition, all except Box<T> impl CloneableCartablePointerLike, which allows CartableOptionPointer to implement Clone.

Structs§

CartableOptionPointer
A type with similar semantics as Option<C<T>> but with a niche.

Traits§

CartablePointerLike
An object fully representable by a non-null pointer.
CloneableCartablePointerLike
An object that implements CartablePointerLike that also supports cloning without changing the address of referenced data.