Skip to main content

AsyncLockKpThenLockKp

Struct AsyncLockKpThenLockKp 

Source
pub struct AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second> { /* private fields */ }
Expand description

Keypath that goes through an async lock then a sync crate::lock::LockKp. Use AsyncLockKp::then_lock to create; then call AsyncLockKpThenLockKp::get or AsyncLockKpThenLockKp::get_mut with root.

Implementations§

Source§

impl<R, V2, Root, Value2, MutRoot, MutValue2, Lock, Mid, V, LockValue, MidValue, Value, MutLock, MutMid, MutValue, G1, S1, L, G2, S2, Lock2, Mid2, LockValue2, MidValue2, MutLock2, MutMid2, G2_1, S2_1, L2, G2_2, S2_2> AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, AsyncLockKp<R, Lock, Mid, V, Root, LockValue, MidValue, Value, MutRoot, MutLock, MutMid, MutValue, G1, S1, L, G2, S2>, LockKp<V, Lock2, Mid2, V2, Value, LockValue2, MidValue2, Value2, MutValue, MutLock2, MutMid2, MutValue2, G2_1, S2_1, L2, G2_2, S2_2>>
where Root: Borrow<R>, LockValue: Borrow<Lock>, MidValue: Borrow<Mid>, Value: Borrow<V>, MutRoot: BorrowMut<R>, MutLock: BorrowMut<Lock>, MutMid: BorrowMut<Mid>, MutValue: BorrowMut<V>, Value2: Borrow<V2>, MutValue2: BorrowMut<V2>, G1: Fn(Root) -> Option<LockValue> + Clone, S1: Fn(MutRoot) -> Option<MutLock> + Clone, L: AsyncLockLike<Lock, MidValue> + AsyncLockLike<Lock, MutMid> + Clone, G2: Fn(MidValue) -> Option<Value> + Clone, S2: Fn(MutMid) -> Option<MutValue> + Clone, LockValue2: Borrow<Lock2>, MidValue2: Borrow<Mid2>, MutLock2: BorrowMut<Lock2>, MutMid2: BorrowMut<Mid2>, G2_1: Fn(Value) -> Option<LockValue2>, S2_1: Fn(MutValue) -> Option<MutLock2>, L2: LockAccess<Lock2, MidValue2> + LockAccess<Lock2, MutMid2>, G2_2: Fn(MidValue2) -> Option<Value2>, S2_2: Fn(MutMid2) -> Option<MutValue2>, Lock: Clone, V: Clone, V2: Clone,

Source

pub async fn get(&self, root: Root) -> Option<Value2>

Get through async lock then sync lock (root is passed here).

Source

pub async fn get_mut(&self, root: MutRoot) -> Option<MutValue2>

Get mutable through async lock then sync lock (root is passed here).

Source§

impl<R, V2, Root, Value2, MutRoot, MutValue2, Lock3, Mid3, LockValue3, MidValue3, MutLock3, MutMid3, G3_1, S3_1, L3, G3_2, S3_2, First, Second> AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, ComposedAsyncLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>, LockKp<Value2, Lock3, Mid3, V2, Value2, LockValue3, MidValue3, Value2, MutValue2, MutLock3, MutMid3, MutValue2, G3_1, S3_1, L3, G3_2, S3_2>>
where First: AsyncKeyPathLike<Root, MutRoot>, Second: AsyncKeyPathLike<First::Value, First::MutValue, Value = Value2, MutValue = MutValue2>, Value2: Borrow<V2> + Clone, MutValue2: BorrowMut<Value2> + BorrowMut<V2>, LockValue3: Borrow<Lock3>, MidValue3: Borrow<Mid3>, MutLock3: BorrowMut<Lock3>, MutMid3: BorrowMut<Mid3>, G3_1: Fn(Value2) -> Option<LockValue3>, S3_1: Fn(MutValue2) -> Option<MutLock3>, L3: LockAccess<Lock3, MidValue3> + LockAccess<Lock3, MutMid3>, G3_2: Fn(MidValue3) -> Option<Value2>, S3_2: Fn(MutMid3) -> Option<MutValue2>, V2: Clone,

Source

pub async fn get(&self, root: Root) -> Option<Value2>

Get through composed async then sync lock (root is passed here).

Source

pub async fn get_mut(&self, root: MutRoot) -> Option<MutValue2>

Get mutable through composed async then sync lock (root is passed here).

Source§

impl<R, V2, Root, Value2, MutRoot, MutValue2, Lock3, Mid3, LockValue3, MidValue3, MutLock3, MutMid3, G3_1, S3_1, L3, G3_2, S3_2, F, S> AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, F, S>, LockKp<Value2, Lock3, Mid3, V2, Value2, LockValue3, MidValue3, Value2, MutValue2, MutLock3, MutMid3, MutValue2, G3_1, S3_1, L3, G3_2, S3_2>>
where F: AsyncKeyPathLike<Root, MutRoot, Value = Value2, MutValue = MutValue2>, S: SyncKeyPathLike<Value2, Value2, MutValue2, MutValue2>, Value2: Borrow<V2> + Clone, MutValue2: BorrowMut<Value2> + BorrowMut<V2>, LockValue3: Borrow<Lock3>, MidValue3: Borrow<Mid3>, MutLock3: BorrowMut<Lock3>, MutMid3: BorrowMut<Mid3>, G3_1: Fn(Value2) -> Option<LockValue3>, S3_1: Fn(MutValue2) -> Option<MutLock3>, L3: LockAccess<Lock3, MidValue3> + LockAccess<Lock3, MutMid3>, G3_2: Fn(MidValue3) -> Option<Value2>, S3_2: Fn(MutMid3) -> Option<MutValue2>, V2: Clone,

Source

pub async fn get(&self, root: Root) -> Option<Value2>

Get through async then sync then sync lock (root is passed here).

Source

pub async fn get_mut(&self, root: MutRoot) -> Option<MutValue2>

Get mutable through async then sync then sync lock (root is passed here).

Source§

impl<R, V2, Root, Value2, MutRoot, MutValue2, First, Second> AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>
where First: AsyncKeyPathLike<Root, MutRoot>,

Source

pub fn then_async<Lock3, Mid3, V3, LockValue3, MidValue3, Value3, MutLock3, MutMid3, MutValue3, G3_1, S3_1, L3, G3_2, S3_2>( self, other: AsyncLockKp<Value2, Lock3, Mid3, V3, Value2, LockValue3, MidValue3, Value3, MutValue2, MutLock3, MutMid3, MutValue3, G3_1, S3_1, L3, G3_2, S3_2>, ) -> ComposedAsyncLockKp<Root, V3, Root, Value3, MutRoot, MutValue3, Self, AsyncLockKp<Value2, Lock3, Mid3, V3, Value2, LockValue3, MidValue3, Value3, MutValue2, MutLock3, MutMid3, MutValue3, G3_1, S3_1, L3, G3_2, S3_2>>
where V2: 'static, V3: 'static, Value2: Borrow<V2>, Value3: Borrow<V3>, MutValue2: BorrowMut<V2> + BorrowMut<Value2>, MutValue3: BorrowMut<V3>, LockValue3: Borrow<Lock3>, MidValue3: Borrow<Mid3>, MutLock3: BorrowMut<Lock3>, MutMid3: BorrowMut<Mid3>, G3_1: Fn(Value2) -> Option<LockValue3> + Clone, S3_1: Fn(MutValue2) -> Option<MutLock3> + Clone, L3: AsyncLockLike<Lock3, MidValue3> + AsyncLockLike<Lock3, MutMid3> + Clone, G3_2: Fn(MidValue3) -> Option<Value3> + Clone, S3_2: Fn(MutMid3) -> Option<MutValue3> + Clone, Lock3: Clone,

Chain with an async keypath (e.g. tokio RwLock): … -> Value2 -> async lock -> Value3. Use .get(&root).await or .get_mut(...).await on the returned ComposedAsyncLockKp.

Source

pub fn then_lock<Lock3, Mid3, V3, LockValue3, MidValue3, Value3, MutLock3, MutMid3, MutValue3, G3_1, S3_1, L3, G3_2, S3_2>( self, lock_kp: LockKp<Value2, Lock3, Mid3, V3, Value2, LockValue3, MidValue3, Value3, MutValue2, MutLock3, MutMid3, MutValue3, G3_1, S3_1, L3, G3_2, S3_2>, ) -> AsyncLockKpThenLockKp<R, V3, Root, Value3, MutRoot, MutValue3, Self, LockKp<Value2, Lock3, Mid3, V3, Value2, LockValue3, MidValue3, Value3, MutValue2, MutLock3, MutMid3, MutValue3, G3_1, S3_1, L3, G3_2, S3_2>>
where V3: 'static, Value2: Borrow<V2>, Value3: Borrow<V3>, MutValue2: BorrowMut<Value2>, MutValue3: BorrowMut<V3>, LockValue3: Borrow<Lock3>, MidValue3: Borrow<Mid3>, MutLock3: BorrowMut<Lock3>, MutMid3: BorrowMut<Mid3>, G3_1: Fn(Value2) -> Option<LockValue3>, S3_1: Fn(MutValue2) -> Option<MutLock3>, L3: LockAccess<Lock3, MidValue3> + LockAccess<Lock3, MutMid3>, G3_2: Fn(MidValue3) -> Option<Value3>, S3_2: Fn(MutMid3) -> Option<MutValue3>,

Chain with another sync crate::lock::LockKp. Use .get(&root).await later.

Source

pub fn then<V3, Value3, MutValue3, G3, S3>( self, next_kp: Kp<Value2, V3, Value2, Value3, MutValue2, MutValue3, G3, S3>, ) -> AsyncKeyPathThenKp<R, V3, Root, Value3, MutRoot, MutValue3, Self, Kp<Value2, V3, Value2, Value3, MutValue2, MutValue3, G3, S3>>
where V3: 'static, Value2: Borrow<V2>, Value3: Borrow<V3>, MutValue2: BorrowMut<Value2>, MutValue3: BorrowMut<V3>, G3: Fn(Value2) -> Option<Value3> + Clone, S3: Fn(MutValue2) -> Option<MutValue3> + Clone,

Chain with a regular crate::Kp. Use .get(&root).await later.

Trait Implementations§

Source§

impl<R, V2, Root, Value2, MutRoot, MutValue2, First, Second> AsyncKeyPathLike<Root, MutRoot> for AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>
where First: AsyncKeyPathLike<Root, MutRoot>, Second: SyncKeyPathLike<First::Value, Value2, First::MutValue, MutValue2>,

Source§

type Value = Value2

Value type at the end of the keypath.
Source§

type MutValue = MutValue2

Mutable value type at the end of the keypath.
Source§

fn get<'life0, 'async_trait>( &'life0 self, root: Root, ) -> Pin<Box<dyn Future<Output = Option<Value2>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the value at the end of the keypath.
Source§

fn get_mut<'life0, 'async_trait>( &'life0 self, root: MutRoot, ) -> Pin<Box<dyn Future<Output = Option<MutValue2>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get mutable access to the value at the end of the keypath.
Source§

impl<R: Clone, V2: Clone, Root: Clone, Value2: Clone, MutRoot: Clone, MutValue2: Clone, First: Clone, Second: Clone> Clone for AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>

Source§

fn clone( &self, ) -> AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<R, V2, Root, Value2, MutRoot, MutValue2, First, Second> Freeze for AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>
where First: Freeze, Second: Freeze,

§

impl<R, V2, Root, Value2, MutRoot, MutValue2, First, Second> RefUnwindSafe for AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>
where First: RefUnwindSafe, Second: RefUnwindSafe, R: RefUnwindSafe, V2: RefUnwindSafe, Root: RefUnwindSafe, Value2: RefUnwindSafe, MutRoot: RefUnwindSafe, MutValue2: RefUnwindSafe,

§

impl<R, V2, Root, Value2, MutRoot, MutValue2, First, Second> Send for AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>
where First: Send, Second: Send, R: Send, V2: Send, Root: Send, Value2: Send, MutRoot: Send, MutValue2: Send,

§

impl<R, V2, Root, Value2, MutRoot, MutValue2, First, Second> Sync for AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>
where First: Sync, Second: Sync, R: Sync, V2: Sync, Root: Sync, Value2: Sync, MutRoot: Sync, MutValue2: Sync,

§

impl<R, V2, Root, Value2, MutRoot, MutValue2, First, Second> Unpin for AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>
where First: Unpin, Second: Unpin, R: Unpin, V2: Unpin, Root: Unpin, Value2: Unpin, MutRoot: Unpin, MutValue2: Unpin,

§

impl<R, V2, Root, Value2, MutRoot, MutValue2, First, Second> UnwindSafe for AsyncLockKpThenLockKp<R, V2, Root, Value2, MutRoot, MutValue2, First, Second>
where First: UnwindSafe, Second: UnwindSafe, R: UnwindSafe, V2: UnwindSafe, Root: UnwindSafe, Value2: UnwindSafe, MutRoot: UnwindSafe, MutValue2: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.