[][src]Struct ghetto_lock::Guard

pub struct Guard<'l, 'b> { /* fields omitted */ }

Lock guard returned after successfully acquiring a lock. The lock is automatically released when the Guard is dropped.

Note: The PartialEq impl only exists to make error handling simple. Guards should never be compared. It always returns false.

Methods

impl<'a, 'b> Guard<'a, 'b>[src]

pub unsafe fn try_release(self) -> Result<bool, LockError>[src]

Releases the lock by deleting the key in memcache. This function is NOT safe as of now because the operations used are not atomic. The CAS command required to safely release the lock is not implemented by the memcache library yet.

Returns Ok(true) when the lock is successfully released.

Trait Implementations

impl<'l, 'b> Debug for Guard<'l, 'b>[src]

impl<'a, 'b> Drop for Guard<'a, 'b>[src]

impl<'l, 'b> PartialEq<Guard<'l, 'b>> for Guard<'l, 'b>[src]

Auto Trait Implementations

impl<'l, 'b> RefUnwindSafe for Guard<'l, 'b>

impl<'l, 'b> Send for Guard<'l, 'b>

impl<'l, 'b> Sync for Guard<'l, 'b>

impl<'l, 'b> Unpin for Guard<'l, 'b> where
    'b: 'l, 

impl<'l, 'b> !UnwindSafe for Guard<'l, 'b>

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, 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.

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