pub struct ArcMutexWritableKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>where
F: for<'r> Fn(&'r Root) -> &'r MutexValue,
G: for<'r> Fn(&'r mut InnerValue) -> &'r mut SubValue,{ /* private fields */ }Expand description
A composed writable keypath chain through Arc<Mutex
Implementations§
Source§impl<Root, MutexValue, InnerValue, SubValue, F, G> ArcMutexWritableKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>where
F: for<'r> Fn(&'r Root) -> &'r MutexValue,
G: for<'r> Fn(&'r mut InnerValue) -> &'r mut SubValue,
MutexValue: Borrow<Arc<Mutex<InnerValue>>>,
impl<Root, MutexValue, InnerValue, SubValue, F, G> ArcMutexWritableKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>where
F: for<'r> Fn(&'r Root) -> &'r MutexValue,
G: for<'r> Fn(&'r mut InnerValue) -> &'r mut SubValue,
MutexValue: Borrow<Arc<Mutex<InnerValue>>>,
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 Consumes self - functional style (compose once, apply once)
Sourcepub fn then<NextValue, H>(
self,
next: WritableKeyPath<SubValue, NextValue, H>,
) -> ArcMutexWritableKeyPathChain<Root, MutexValue, 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>,
) -> ArcMutexWritableKeyPathChain<Root, MutexValue, 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>,
) -> ArcMutexWritableOptionalKeyPathChain<Root, MutexValue, 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>,
) -> ArcMutexWritableOptionalKeyPathChain<Root, MutexValue, 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, MutexValue, InnerValue, SubValue, F, G> Freeze for ArcMutexWritableKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>
impl<Root, MutexValue, InnerValue, SubValue, F, G> RefUnwindSafe for ArcMutexWritableKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>where
F: RefUnwindSafe,
G: RefUnwindSafe,
Root: RefUnwindSafe,
MutexValue: RefUnwindSafe,
InnerValue: RefUnwindSafe,
SubValue: RefUnwindSafe,
impl<Root, MutexValue, InnerValue, SubValue, F, G> Send for ArcMutexWritableKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>
impl<Root, MutexValue, InnerValue, SubValue, F, G> Sync for ArcMutexWritableKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>
impl<Root, MutexValue, InnerValue, SubValue, F, G> Unpin for ArcMutexWritableKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>
impl<Root, MutexValue, InnerValue, SubValue, F, G> UnwindSafe for ArcMutexWritableKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>where
F: UnwindSafe,
G: UnwindSafe,
Root: UnwindSafe,
MutexValue: 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