[go: up one dir, main page]

Struct lever::txn::vars::TVar[][src]

pub struct TVar<T> where
    T: Clone + Any + Send + Sync
{ /* fields omitted */ }

Transactional variable

Implementations

impl<T> TVar<T> where
    T: Clone + Any + Send + Sync
[src]

pub fn new(data: T) -> Self[src]

Instantiates transactional variable for later use in a transaction.

pub fn new_with_timeout(data: T, timeout: usize) -> Self[src]

New transactional variable with overridden timeout for overriding timeout for specific transactional variable.

Highly discouraged for the daily use unless you have various code paths that can interfere over the variable that you instantiate.

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

Get's the underlying data for the transactional variable.

Beware that this will not give correct results any given point in time during the course of execution of a transaction.

Trait Implementations

impl<T: Clone> Clone for TVar<T> where
    T: Clone + Any + Send + Sync
[src]

impl<T: Any + Clone + Send + Sync> Deref for TVar<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T: 'static + Any + Clone + Send + Sync> DerefMut for TVar<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for TVar<T>[src]

impl<T> Send for TVar<T>[src]

impl<T> Sync for TVar<T>[src]

impl<T> Unpin for TVar<T> where
    T: Unpin
[src]

impl<T> !UnwindSafe for TVar<T>[src]

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.