Skip to main content

Crate key_paths_core

Crate key_paths_core 

Source
Expand description

Lightweight, dependency-free keypath traits for Rust.

Implement Readable and Writable on your keypath types so callers can navigate roots uniformly. Use KpTrait for TypeId helpers and KpTrait::then composition.

Higher-level crates (for example rust-key-paths) add concrete keypath structs, chaining, and lock/async adapters on top of these traits.

Traitsยง

AccessorTrait
Optional-root and fallback helpers built on Readable / Writable.
KeyPath
A keypath that supports both read and write navigation.
KeyPathValueTarget
Used so async chaining can infer the referent of a reference-valued step (e.g. &T and &mut T both map to T).
KpTrait
Logical root/value type identity and composition for a keypath.
Readable
Read-only keypath: navigate from Root to Value.
Writable
Mutable keypath: setter path (same semantics as a get_mut closure on many keypath APIs).