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//! - `rust_keypaths` - Direct re-export (required for proc macros)
7//! - `kp` - Short alias for `rust-keypaths`
8//! - `kpm` - Short alias for `keypaths-proc`
9//!
10//! ## Usage
11//!
12//! ```rust
13//! use rust_key_paths::kpm::Keypaths;
14//! use rust_key_paths::rust_keypaths; // Required for derive macros
15//!
16//! #[derive(Keypaths)]
17//! #[Writable]
18//! struct MyStruct {
19//! field: String,
20//! }
21//! ```
22
23// Direct re-export required for proc macros to resolve `rust_keypaths::`
24pub use rust_keypaths;
25
26/// Re-export of `rust-keypaths` - the core keypaths library (short alias)
27pub use rust_keypaths as kp;
28
29/// Re-export of `keypaths-proc` - the proc-macro derive library
30pub use keypaths_proc as kpm;
31
32// Re-export commonly used items at the root for convenience
33pub use rust_keypaths::{
34 KeyPath, OptionalKeyPath, WritableKeyPath, WritableOptionalKeyPath,
35};
36
37// Re-export derive macros at the root for convenience
38pub use keypaths_proc::{Keypaths, Casepaths};