Expand description
Core types for pathmod
This crate provides the runtime Accessor<T, F> type used by the derive macros in pathmod_derive and re-exported by the pathmod crate.
Clone requirements for set_clone (MVP):
Accessor::set_clone(&mut T, &F)clones the provided value at the top level and writes it into the focused field.- Only
F: Cloneis required. The root typeTdoes not need to implementClonefor this operation. - When composing accessors (e.g.,
Accessor<T, U>.compose(Accessor<U, V>)), callingset_cloneon the composed accessor still only requiresV: Clone.
Safety notes:
- Internally, accessors are represented by a byte offset and use unsafe pointer arithmetic to project fields. The public API is safe when accessors are constructed by the provided derive macros or
from_fns.
Modules§
Structs§
- Accessor
- A small, copyable accessor that focuses into a field F inside a root T.