Crate pathmod_core

Crate pathmod_core 

Source
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: Clone is required. The root type T does not need to implement Clone for this operation.
  • When composing accessors (e.g., Accessor<T, U>.compose(Accessor<U, V>)), calling set_clone on the composed accessor still only requires V: 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§

prelude

Structs§

Accessor
A small, copyable accessor that focuses into a field F inside a root T.

Traits§

Indexing