pub struct ArcParkingRwLockWritableOptionalKeyPathChain<Root, InnerValue, SubValue, F, G>where
F: for<'r> Fn(&'r Root) -> &'r Arc<RwLock<RawRwLock, InnerValue>>,
G: for<'r> Fn(&'r mut InnerValue) -> Option<&'r mut SubValue>,{ /* private fields */ }Expand description
A composed writable optional keypath chain through Arc<parking_lot::RwLock
Implementations§
Source§impl<Root, InnerValue, SubValue, F, G> ArcParkingRwLockWritableOptionalKeyPathChain<Root, InnerValue, SubValue, F, G>where
F: for<'r> Fn(&'r Root) -> &'r Arc<RwLock<RawRwLock, InnerValue>>,
G: for<'r> Fn(&'r mut InnerValue) -> Option<&'r mut SubValue>,
impl<Root, InnerValue, SubValue, F, G> ArcParkingRwLockWritableOptionalKeyPathChain<Root, InnerValue, SubValue, F, G>where
F: for<'r> Fn(&'r Root) -> &'r Arc<RwLock<RawRwLock, InnerValue>>,
G: for<'r> Fn(&'r mut InnerValue) -> Option<&'r mut SubValue>,
Sourcepub fn get_mut<Callback, R>(
self,
container: &Root,
callback: Callback,
) -> Option<R>where
Callback: FnOnce(&mut SubValue) -> R,
pub fn get_mut<Callback, R>(
self,
container: &Root,
callback: Callback,
) -> Option<R>where
Callback: FnOnce(&mut SubValue) -> R,
Apply the composed keypath chain to a container with mutable access (write lock, if value exists)
Sourcepub fn then<NextValue, H>(
self,
next: WritableKeyPath<SubValue, NextValue, H>,
) -> ArcParkingRwLockWritableOptionalKeyPathChain<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>,
) -> ArcParkingRwLockWritableOptionalKeyPathChain<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 another 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 ArcParkingRwLockWritableOptionalKeyPathChain<Root, InnerValue, SubValue, F, G>
impl<Root, InnerValue, SubValue, F, G> !RefUnwindSafe for ArcParkingRwLockWritableOptionalKeyPathChain<Root, InnerValue, SubValue, F, G>
impl<Root, InnerValue, SubValue, F, G> Send for ArcParkingRwLockWritableOptionalKeyPathChain<Root, InnerValue, SubValue, F, G>
impl<Root, InnerValue, SubValue, F, G> Sync for ArcParkingRwLockWritableOptionalKeyPathChain<Root, InnerValue, SubValue, F, G>
impl<Root, InnerValue, SubValue, F, G> Unpin for ArcParkingRwLockWritableOptionalKeyPathChain<Root, InnerValue, SubValue, F, G>
impl<Root, InnerValue, SubValue, F, G> !UnwindSafe for ArcParkingRwLockWritableOptionalKeyPathChain<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