Module yoke::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
:
&T
Box<T>
Rc<T>
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§
- A type with similar semantics as
Option<C<T>>
but with a niche.
Traits§
- An object fully representable by a non-null pointer.
- An object that implements
CartablePointerLike
that also supports cloning without changing the address of referenced data.