Expand description
Crate to experiment with the API proposed in https://nadrieril.github.io/blog/2025/11/11/truly-first-class-custom-smart-pointers.html.
Modules§
- basic_
impls 🔒 - projection 🔒
- place_
ops 🔒
Macros§
- mk_
field_ proj - Make a unit struct that represents the projection to a particular struct field. Only works for sized types.
- p
- Macro that simulates the proposed new syntax. Derefs must be explicit and
the identifiers used for field projections must actually be values of some
Projectiontype, e.g. built withmk_field_proj.
Structs§
- Noop
Proj - Sized
Proj - Sized projection that holds only an offset.
- Compose
Proj - Projection
Pfollowed byQ.Pmay be unsized.
Enums§
Traits§
- Projection
- Projection
Ext - HasPlace
- Place
Borrow - Borrow a subplace.
- Place
Read - Read a value from a subplace.
- Place
Write - Write to a subplace.
- Place
Move - Allows moving a value out of a subplace. This uses
PlaceRead::readto read the value. - Place
Deref - Allows dereferencing a subplace that contains a pointer. The returned pointer will only be used for further place operations.
- Place
Drop - Drop the contents of a subplace.
- Drop
Husk - Clean up a pointer whose contained place has been moved out of/dropped.
- Place
Coerce - If at a coercion site an expression
ehas typeTbut typeUwas expected, andT: HasPlaceandT::Target: PlaceCoerce<T>, then we replaceewith@T::Target::Output **eand repeat this until types match and raise an error otherwise. - Place
Wrap - If
X: PlaceWrapandX::Targethas a fieldfield, thenXitself acquires a virtual field namedfieldas well. That field has type<X as PlaceWrap<proj_ty!(X::Target.field)>>::WrappedProj::Target, andWrappedProjis the projection used when we refer to that field.