pub struct ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, SubValue, F, G>where
F: for<'r> Fn(&'r Root) -> &'r Arc<RwLock<RawRwLock, InnerValue>>,
G: for<'r> Fn(&'r mut InnerValue) -> &'r mut SubValue,{ /* private fields */ }Expand description
A composed writable keypath chain through Arc<parking_lot::RwLock
Implementations§
Source§impl<Root, InnerValue, SubValue, F, G> ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, SubValue, F, G>where
F: for<'r> Fn(&'r Root) -> &'r Arc<RwLock<RawRwLock, InnerValue>>,
G: for<'r> Fn(&'r mut InnerValue) -> &'r mut SubValue,
impl<Root, InnerValue, SubValue, F, G> ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, SubValue, F, G>where
F: for<'r> Fn(&'r Root) -> &'r Arc<RwLock<RawRwLock, InnerValue>>,
G: for<'r> Fn(&'r mut InnerValue) -> &'r mut SubValue,
Sourcepub fn get_mut<Callback, R>(self, container: &Root, callback: Callback) -> Rwhere
Callback: FnOnce(&mut SubValue) -> R,
pub fn get_mut<Callback, R>(self, container: &Root, callback: Callback) -> Rwhere
Callback: FnOnce(&mut SubValue) -> R,
Apply the composed keypath chain to a container with mutable access (write lock)
Sourcepub fn then<NextValue, H>(
self,
next: WritableKeyPath<SubValue, NextValue, H>,
) -> ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, NextValue, F, impl for<'r> Fn(&'r mut InnerValue) + 'static>where
H: for<'r> Fn(&'r mut SubValue) -> &'r mut NextValue + 'static,
G: 'static,
InnerValue: 'static,
SubValue: 'static,
NextValue: 'static,
pub fn then<NextValue, H>(
self,
next: WritableKeyPath<SubValue, NextValue, H>,
) -> ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, NextValue, F, impl for<'r> Fn(&'r mut InnerValue) + 'static>where
H: for<'r> Fn(&'r mut SubValue) -> &'r mut NextValue + 'static,
G: 'static,
InnerValue: 'static,
SubValue: 'static,
NextValue: 'static,
Monadic composition: chain with another writable keypath
This allows composing deeper keypaths through the same Arc<parking_lot::RwLock
Sourcepub fn chain_optional<NextValue, H>(
self,
next: WritableOptionalKeyPath<SubValue, NextValue, H>,
) -> ArcParkingRwLockWritableOptionalKeyPathChain<Root, InnerValue, NextValue, F, impl for<'r> Fn(&'r mut InnerValue) + 'static>where
H: for<'r> Fn(&'r mut SubValue) -> Option<&'r mut NextValue> + 'static,
G: 'static,
InnerValue: 'static,
SubValue: 'static,
NextValue: 'static,
pub fn chain_optional<NextValue, H>(
self,
next: WritableOptionalKeyPath<SubValue, NextValue, H>,
) -> ArcParkingRwLockWritableOptionalKeyPathChain<Root, InnerValue, NextValue, F, impl for<'r> Fn(&'r mut InnerValue) + 'static>where
H: for<'r> Fn(&'r mut SubValue) -> Option<&'r mut NextValue> + 'static,
G: 'static,
InnerValue: 'static,
SubValue: 'static,
NextValue: 'static,
Monadic composition: chain with a writable optional keypath (for Option fields)
This allows composing through Option types within the same Arc<parking_lot::RwLock
Auto Trait Implementations§
impl<Root, InnerValue, SubValue, F, G> Freeze for ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, SubValue, F, G>
impl<Root, InnerValue, SubValue, F, G> !RefUnwindSafe for ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, SubValue, F, G>
impl<Root, InnerValue, SubValue, F, G> Send for ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, SubValue, F, G>
impl<Root, InnerValue, SubValue, F, G> Sync for ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, SubValue, F, G>
impl<Root, InnerValue, SubValue, F, G> Unpin for ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, SubValue, F, G>
impl<Root, InnerValue, SubValue, F, G> !UnwindSafe for ArcParkingRwLockWritableKeyPathChain<Root, InnerValue, SubValue, F, G>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more