pub struct OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, InnerValue, SubValue, F, G>where
RwLockValue: Borrow<Arc<RwLock<InnerValue>>>,
F: for<'r> Fn(&'r Root) -> Option<&'r RwLockValue>,
G: for<'r> Fn(&'r mut InnerValue) -> &'r mut SubValue,{ /* private fields */ }Expand description
A composed writable async keypath chain from optional keypath through Arc<tokio::sync::RwLock
Implementations§
Source§impl<Root, RwLockValue, InnerValue, SubValue, F, G> OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, InnerValue, SubValue, F, G>where
RwLockValue: Borrow<Arc<RwLock<InnerValue>>>,
F: for<'r> Fn(&'r Root) -> Option<&'r RwLockValue>,
G: for<'r> Fn(&'r mut InnerValue) -> &'r mut SubValue,
impl<Root, RwLockValue, InnerValue, SubValue, F, G> OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, InnerValue, SubValue, F, G>where
RwLockValue: Borrow<Arc<RwLock<InnerValue>>>,
F: for<'r> Fn(&'r Root) -> Option<&'r RwLockValue>,
G: for<'r> Fn(&'r mut InnerValue) -> &'r mut SubValue,
Sourcepub async fn get_mut<Callback, R>(
self,
container: &Root,
callback: Callback,
) -> Option<R>where
Callback: FnOnce(&mut SubValue) -> R,
pub async 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, async)
Sourcepub fn then<NextValue, H>(
self,
next: WritableKeyPath<SubValue, NextValue, H>,
) -> OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, 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>,
) -> OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, 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,
Chain with another writable keypath through another level
Sourcepub fn chain_optional<NextValue, H>(
self,
next: WritableOptionalKeyPath<SubValue, NextValue, H>,
) -> OptionalArcTokioRwLockWritableOptionalKeyPathChain<Root, RwLockValue, 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>,
) -> OptionalArcTokioRwLockWritableOptionalKeyPathChain<Root, RwLockValue, 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,
Chain with an optional writable keypath through another level
Auto Trait Implementations§
impl<Root, RwLockValue, InnerValue, SubValue, F, G> Freeze for OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, InnerValue, SubValue, F, G>
impl<Root, RwLockValue, InnerValue, SubValue, F, G> RefUnwindSafe for OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, InnerValue, SubValue, F, G>where
F: RefUnwindSafe,
G: RefUnwindSafe,
Root: RefUnwindSafe,
RwLockValue: RefUnwindSafe,
InnerValue: RefUnwindSafe,
SubValue: RefUnwindSafe,
impl<Root, RwLockValue, InnerValue, SubValue, F, G> Send for OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, InnerValue, SubValue, F, G>
impl<Root, RwLockValue, InnerValue, SubValue, F, G> Sync for OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, InnerValue, SubValue, F, G>
impl<Root, RwLockValue, InnerValue, SubValue, F, G> Unpin for OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, InnerValue, SubValue, F, G>
impl<Root, RwLockValue, InnerValue, SubValue, F, G> UnwindSafe for OptionalArcTokioRwLockWritableKeyPathChain<Root, RwLockValue, InnerValue, SubValue, F, G>where
F: UnwindSafe,
G: UnwindSafe,
Root: UnwindSafe,
RwLockValue: UnwindSafe,
InnerValue: UnwindSafe,
SubValue: UnwindSafe,
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