Skip to main content

Crate rust_key_paths

Crate rust_key_paths 

Source

Re-exports§

pub use lock::ArcMutexAccess;
pub use lock::ArcRwLockAccess;
pub use lock::LockAccess;
pub use lock::LockKp;
pub use lock::LockKpType;
pub use lock::RcRefCellAccess;
pub use lock::StdMutexAccess;
pub use lock::StdRwLockAccess;

Modules§

async_lock
Async Lock Keypath Module
lock
Lock Keypath Module

Structs§

AKp
EnumKp
EnumKp - A keypath for enum variants that supports both extraction and embedding Leverages the existing Kp architecture where optionals are built-in via Option
Kp
AKp (AnyKeyPath) - Hides both Root and Value types Most flexible keypath type for heterogeneous collections Uses dynamic dispatch and type checking at runtime
PKp

Traits§

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.

Functions§

enum_err
Extract from Result<T, E> - Err variant
enum_ok
Extract from Result<T, E> - Ok variant
enum_some
Extract from Option - Some variant
enum_variant
Create an enum keypath with both extraction and embedding for a specific variant
kp_arc
Create a keypath for unwrapping Arc -> T (read-only)
kp_box
Create a keypath for unwrapping Box -> T
kp_rc
Create a keypath for unwrapping Rc -> T (read-only)
variant_of
Create an enum keypath for a specific variant with type inference
zip_kps
Zip two keypaths together to create a tuple Works only with KpType (reference-based keypaths)

Type Aliases§

EnumKpType
KpComposed
KpDynamic
KpType