pub trait AsyncKeyPathLike<Root, MutRoot> {
type Value;
type MutValue;
// Required methods
fn get<'life0, 'async_trait>(
&'life0 self,
root: Root,
) -> Pin<Box<dyn Future<Output = Option<Self::Value>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_mut<'life0, 'async_trait>(
&'life0 self,
root: MutRoot,
) -> Pin<Box<dyn Future<Output = Option<Self::MutValue>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for async keypaths (both AsyncLockKp and ComposedAsyncLockKp) so composition can be any depth.
§Why MutRoot? (RwLock/Mutex interior mutability)
RwLock and Mutex provide interior mutability—their lock() / write() methods take &self,
so you can mutate through an immutable reference. For async lock keypaths, the mutation
happens inside the lock; you do not need a mutable root. MutRoot exists for composition
with sync keypaths (e.g. Kp) that may require &mut along the path. When the path goes
entirely through locks (RwLock/Mutex), Root and MutRoot are typically the same type
(e.g. &Root for both).