pub struct ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>where
F: for<'r> Fn(&'r Root) -> &'r MutexValue,
G: for<'r> Fn(&'r InnerValue) -> Option<&'r SubValue>,{ /* private fields */ }Expand description
A composed optional async keypath chain through Arc<tokio::sync::Mutex
Implementations§
Source§impl<Root, MutexValue, InnerValue, SubValue, F, G> ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>where
MutexValue: Borrow<Arc<Mutex<InnerValue>>>,
F: for<'r> Fn(&'r Root) -> &'r MutexValue,
G: for<'r> Fn(&'r InnerValue) -> Option<&'r SubValue>,
impl<Root, MutexValue, InnerValue, SubValue, F, G> ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>where
MutexValue: Borrow<Arc<Mutex<InnerValue>>>,
F: for<'r> Fn(&'r Root) -> &'r MutexValue,
G: for<'r> Fn(&'r InnerValue) -> Option<&'r SubValue>,
Sourcepub async fn get<Callback>(
self,
container: &Root,
callback: Callback,
) -> Option<()>
pub async fn get<Callback>( self, container: &Root, callback: Callback, ) -> Option<()>
Apply the composed keypath chain to a container (read, if value exists, async)
Sourcepub fn then<NextValue, H>(
self,
next: KeyPath<SubValue, NextValue, H>,
) -> ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, NextValue, F, impl for<'r> Fn(&'r InnerValue) + 'static>where
H: for<'r> Fn(&'r SubValue) -> &'r NextValue + 'static,
G: 'static,
InnerValue: 'static,
SubValue: 'static,
NextValue: 'static,
pub fn then<NextValue, H>(
self,
next: KeyPath<SubValue, NextValue, H>,
) -> ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, NextValue, F, impl for<'r> Fn(&'r InnerValue) + 'static>where
H: for<'r> Fn(&'r SubValue) -> &'r NextValue + 'static,
G: 'static,
InnerValue: 'static,
SubValue: 'static,
NextValue: 'static,
Chain with another readable keypath through another level
Sourcepub fn chain_optional<NextValue, H>(
self,
next: OptionalKeyPath<SubValue, NextValue, H>,
) -> ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, NextValue, F, impl for<'r> Fn(&'r InnerValue) + 'static>where
H: for<'r> Fn(&'r SubValue) -> Option<&'r NextValue> + 'static,
G: 'static,
InnerValue: 'static,
SubValue: 'static,
NextValue: 'static,
pub fn chain_optional<NextValue, H>(
self,
next: OptionalKeyPath<SubValue, NextValue, H>,
) -> ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, NextValue, F, impl for<'r> Fn(&'r InnerValue) + 'static>where
H: for<'r> Fn(&'r SubValue) -> Option<&'r NextValue> + 'static,
G: 'static,
InnerValue: 'static,
SubValue: 'static,
NextValue: 'static,
Chain with an optional readable keypath through another level
Auto Trait Implementations§
impl<Root, MutexValue, InnerValue, SubValue, F, G> Freeze for ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>
impl<Root, MutexValue, InnerValue, SubValue, F, G> RefUnwindSafe for ArcTokioMutexOptionalKeyPathChain<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 ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>
impl<Root, MutexValue, InnerValue, SubValue, F, G> Sync for ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>
impl<Root, MutexValue, InnerValue, SubValue, F, G> Unpin for ArcTokioMutexOptionalKeyPathChain<Root, MutexValue, InnerValue, SubValue, F, G>
impl<Root, MutexValue, InnerValue, SubValue, F, G> UnwindSafe for ArcTokioMutexOptionalKeyPathChain<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