pub struct KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> { /* private fields */ }Expand description
Implementations§
Source§impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>where
First: SyncKeyPathLike<Root, Value, MutRoot, MutValue>,
Second: SyncKeyPathLike<Value, Value2, MutValue, MutValue2>,
impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>where
First: SyncKeyPathLike<Root, Value, MutRoot, MutValue>,
Second: SyncKeyPathLike<Value, Value2, MutValue, MutValue2>,
Sourcepub fn get_mut(&self, root: MutRoot) -> Option<MutValue2>
pub fn get_mut(&self, root: MutRoot) -> Option<MutValue2>
Get mutable through first then second (sync).
Sourcepub fn get_optional(&self, root: Option<Root>) -> Option<Value2>
pub fn get_optional(&self, root: Option<Root>) -> Option<Value2>
Like get, but takes an optional root.
Sourcepub fn get_mut_optional(&self, root: Option<MutRoot>) -> Option<MutValue2>
pub fn get_mut_optional(&self, root: Option<MutRoot>) -> Option<MutValue2>
Like get_mut, but takes an optional root.
Sourcepub fn get_or_else<F>(&self, root: Option<Root>, f: F) -> Value2where
F: FnOnce() -> Value2,
pub fn get_or_else<F>(&self, root: Option<Root>, f: F) -> Value2where
F: FnOnce() -> Value2,
Returns the value if the keypath succeeds, otherwise calls f and returns its result.
Sourcepub fn get_mut_or_else<F>(&self, root: Option<MutRoot>, f: F) -> MutValue2where
F: FnOnce() -> MutValue2,
pub fn get_mut_or_else<F>(&self, root: Option<MutRoot>, f: F) -> MutValue2where
F: FnOnce() -> MutValue2,
Returns the mutable value if the keypath succeeds, otherwise calls f and returns its result.
Sourcepub fn then<V3, Value3, MutValue3, G3, S3>(
self,
next_kp: Kp<V2, V3, Value2, Value3, MutValue2, MutValue3, G3, S3>,
) -> KpThenLockKp<R, V, V3, Root, Value, Value3, MutRoot, MutValue, MutValue3, First, ComposedSyncKeyPath<Second, Kp<V2, V3, Value2, Value3, MutValue2, MutValue3, G3, S3>, Value2, MutValue2>>
pub fn then<V3, Value3, MutValue3, G3, S3>( self, next_kp: Kp<V2, V3, Value2, Value3, MutValue2, MutValue3, G3, S3>, ) -> KpThenLockKp<R, V, V3, Root, Value, Value3, MutRoot, MutValue, MutValue3, First, ComposedSyncKeyPath<Second, Kp<V2, V3, Value2, Value3, MutValue2, MutValue3, G3, S3>, Value2, MutValue2>>
Chain with a plain Kp after the lock segment (same idea as LockKp::then).
Example: root_kp.then_lock(field_lock()).then(Inner::next_field()).
Sourcepub fn then_lock<Lock2, Mid2, V3, LockValue2, MidValue2, Value3, MutLock2, MutMid2, MutValue3, G2_1, S2_1, L2, G2_2, S2_2>(
self,
other: LockKp<V2, Lock2, Mid2, V3, Value2, LockValue2, MidValue2, Value3, MutValue2, MutLock2, MutMid2, MutValue3, G2_1, S2_1, L2, G2_2, S2_2>,
) -> KpThenLockKp<R, V, V3, Root, Value, Value3, MutRoot, MutValue, MutValue3, First, ComposedSyncKeyPath<Second, LockKp<V2, Lock2, Mid2, V3, Value2, LockValue2, MidValue2, Value3, MutValue2, MutLock2, MutMid2, MutValue3, G2_1, S2_1, L2, G2_2, S2_2>, Value2, MutValue2>>where
V2: 'static,
V3: 'static,
Value2: Borrow<V2>,
LockValue2: Borrow<Lock2>,
MidValue2: Borrow<Mid2>,
Value3: Borrow<V3>,
MutValue2: BorrowMut<V2>,
MutLock2: BorrowMut<Lock2>,
MutMid2: BorrowMut<Mid2>,
MutValue3: BorrowMut<V3>,
G2_1: Fn(Value2) -> Option<LockValue2>,
S2_1: Fn(MutValue2) -> Option<MutLock2>,
L2: LockAccess<Lock2, MidValue2> + LockAccess<Lock2, MutMid2> + Clone + 'static,
G2_2: Fn(MidValue2) -> Option<Value3>,
S2_2: Fn(MutMid2) -> Option<MutValue3>,
pub fn then_lock<Lock2, Mid2, V3, LockValue2, MidValue2, Value3, MutLock2, MutMid2, MutValue3, G2_1, S2_1, L2, G2_2, S2_2>(
self,
other: LockKp<V2, Lock2, Mid2, V3, Value2, LockValue2, MidValue2, Value3, MutValue2, MutLock2, MutMid2, MutValue3, G2_1, S2_1, L2, G2_2, S2_2>,
) -> KpThenLockKp<R, V, V3, Root, Value, Value3, MutRoot, MutValue, MutValue3, First, ComposedSyncKeyPath<Second, LockKp<V2, Lock2, Mid2, V3, Value2, LockValue2, MidValue2, Value3, MutValue2, MutLock2, MutMid2, MutValue3, G2_1, S2_1, L2, G2_2, S2_2>, Value2, MutValue2>>where
V2: 'static,
V3: 'static,
Value2: Borrow<V2>,
LockValue2: Borrow<Lock2>,
MidValue2: Borrow<Mid2>,
Value3: Borrow<V3>,
MutValue2: BorrowMut<V2>,
MutLock2: BorrowMut<Lock2>,
MutMid2: BorrowMut<Mid2>,
MutValue3: BorrowMut<V3>,
G2_1: Fn(Value2) -> Option<LockValue2>,
S2_1: Fn(MutValue2) -> Option<MutLock2>,
L2: LockAccess<Lock2, MidValue2> + LockAccess<Lock2, MutMid2> + Clone + 'static,
G2_2: Fn(MidValue2) -> Option<Value3>,
S2_2: Fn(MutMid2) -> Option<MutValue3>,
Chain with another sync LockKp after the segment so far (same idea as LockKp::then_lock).
Trait Implementations§
Source§impl<R: Clone, V: Clone, V2: Clone, Root: Clone, Value: Clone, Value2: Clone, MutRoot: Clone, MutValue: Clone, MutValue2: Clone, First: Clone, Second: Clone> Clone for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>
impl<R: Clone, V: Clone, V2: Clone, Root: Clone, Value: Clone, Value2: Clone, MutRoot: Clone, MutValue: Clone, MutValue2: Clone, First: Clone, Second: Clone> Clone for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>
Source§fn clone(
&self,
) -> KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>
fn clone( &self, ) -> KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> Debug for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>
impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> Debug for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>
Auto Trait Implementations§
impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> Freeze for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>
impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> RefUnwindSafe for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>where
First: RefUnwindSafe,
Second: RefUnwindSafe,
R: RefUnwindSafe,
V: RefUnwindSafe,
V2: RefUnwindSafe,
Root: RefUnwindSafe,
Value: RefUnwindSafe,
Value2: RefUnwindSafe,
MutRoot: RefUnwindSafe,
MutValue: RefUnwindSafe,
MutValue2: RefUnwindSafe,
impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> Send for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>
impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> Sync for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>
impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> Unpin for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>
impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> UnsafeUnpin for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>where
First: UnsafeUnpin,
Second: UnsafeUnpin,
impl<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second> UnwindSafe for KpThenLockKp<R, V, V2, Root, Value, Value2, MutRoot, MutValue, MutValue2, First, Second>where
First: UnwindSafe,
Second: UnwindSafe,
R: UnwindSafe,
V: UnwindSafe,
V2: UnwindSafe,
Root: UnwindSafe,
Value: UnwindSafe,
Value2: UnwindSafe,
MutRoot: UnwindSafe,
MutValue: UnwindSafe,
MutValue2: 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