Skip to main content

Module kptrait

Module kptrait 

Source
Expand description

Keypath traits: read/write surfaces, chaining, coercion, and higher-order helpers.

KpTrait composes KpReadable (getter path) and KPWritable (setter path, exposed as KPWritable::set) plus KpTrait::then.

Traitsยง

AccessorTrait
ChainExt
CoercionTrait
HofTrait
KPWritable
Mutable keypath surface: setter path (same closure as Kp::get_mut).
KeyPathValueTarget
Used so that then_async can infer V2 from AsyncKp::Value without ambiguity (e.g. &i32 has both Borrow<i32> and Borrow<&i32>; this picks the referent). Implemented only for reference types so there is no overlap with the blanket impl.
KpReadable
Read-only keypath surface: navigate from Root to Value (logical value type V).
KpTrait