Struct tc_transact::lock::TxnLock[][src]

pub struct TxnLock<T: Mutate> { /* fields omitted */ }
Expand description

A lock which provides transaction-specific versions of the locked state.

Implementations

impl<T: Mutate> TxnLock<T>[src]

pub fn new<I: Display>(name: I, value: T) -> TxnLock<T>[src]

Create a new lock.

pub fn try_read(&self, txn_id: &TxnId) -> TCResult<Option<TxnLockReadGuard<T>>>[src]

Try to acquire a read lock synchronously.

pub fn read<'a>(&self, txn_id: &'a TxnId) -> TxnLockReadFuture<'a, T>

Notable traits for TxnLockReadFuture<'a, T>

impl<'a, T: Mutate> Future for TxnLockReadFuture<'a, T> type Output = TCResult<TxnLockReadGuard<T>>;
[src]

Lock this state for reading at the given TxnId.

pub fn try_write(
    &self,
    txn_id: &TxnId
) -> TCResult<Option<TxnLockWriteGuard<T>>>
[src]

Try to acquire a write lock, synchronously.

pub fn write(&self, txn_id: TxnId) -> TxnLockWriteFuture<T>

Notable traits for TxnLockWriteFuture<T>

impl<T: Mutate> Future for TxnLockWriteFuture<T> type Output = TCResult<TxnLockWriteGuard<T>>;
[src]

Lock this state for writing at the given TxnId.

Trait Implementations

impl<T: Mutate> Clone for TxnLock<T>[src]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Mutate> Transact for TxnLock<T>[src]

fn commit<'life0, 'life1, 'async_trait>(
    &'life0 self,
    txn_id: &'life1 TxnId
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Commit this transaction.

fn finalize<'life0, 'life1, 'async_trait>(
    &'life0 self,
    txn_id: &'life1 TxnId
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Delete any version data specific to this transaction.

Auto Trait Implementations

impl<T> RefUnwindSafe for TxnLock<T>

impl<T> Send for TxnLock<T>

impl<T> Sync for TxnLock<T>

impl<T> Unpin for TxnLock<T>

impl<T> UnwindSafe for TxnLock<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<F, T> CastFrom<F> for T where
    T: From<F>, 

pub fn cast_from(f: F) -> T

impl<T, F> CastInto<F> for T where
    F: CastFrom<T>, 

pub fn cast_into(self) -> F

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<F> Match for F

fn matches<T>(&self) -> bool where
    T: TryCastFrom<Self>, 

Returns true if self can be cast into the target type T.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<F, T> TryCastFrom<F> for T where
    T: CastFrom<F>, 

pub fn can_cast_from(&F) -> bool

Test if value can be cast into Self.

pub fn opt_cast_from(f: F) -> Option<T>

Returns Some(Self) if the source value can be cast into Self, otherwise None.

fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
    OnErr: FnOnce(&T) -> Err, 

Returns Ok(Self) if the source value can be cast into Self, otherwise calls on_err.

impl<F, T> TryCastInto<T> for F where
    T: TryCastFrom<F>, 

pub fn can_cast_into(&self) -> bool

Test if self can be cast into T.

pub fn opt_cast_into(self) -> Option<T>

Returns Some(T) if self can be cast into T, otherwise None.

fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
    OnErr: FnOnce(&Self) -> Err, 

Returns Ok(T) if self can be cast into T, otherwise calls on_err.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V