rust_key_paths/lib.rs
1//! # rust-key-paths
2//!
3//! Type-safe, composable keypaths for Rust with zero-cost abstractions.
4//!
5//! This crate re-exports `rust-keypaths` and `keypaths-proc` for convenience:
6//! - `kp` - The core keypaths library (`rust-keypaths`)
7//! - `kpm` - The proc-macro derive library (`keypaths-proc`)
8//!
9//! ## Usage
10//!
11//! ```rust
12//! use rust_key_paths::{kp, kpm};
13//!
14//! // Use derive macros from kpm
15//! #[derive(kpm::Keypaths)]
16//! #[Writable]
17//! struct MyStruct {
18//! field: String,
19//! }
20//!
21//! // Use keypath types from kp
22//! fn example(kp: kp::KeyPath<MyStruct, String, impl Fn(&MyStruct) -> &String>) {
23//! // ...
24//! }
25//! ```
26
27/// Re-export of `rust-keypaths` - the core keypaths library
28pub use rust_keypaths as kp;
29
30/// Re-export of `keypaths-proc` - the proc-macro derive library
31pub use keypaths_proc as kpm;