[][src]Struct bastion_qutex::Qutex

pub struct Qutex<T> { /* fields omitted */ }

A lock-free-queue-backed exclusive data lock.

Methods

impl<T> Qutex<T>[src]

pub fn new(val: T) -> Qutex<T>[src]

Creates and returns a new Qutex.

pub fn lock(self) -> FutureGuard<T>[src]

Returns a new FutureGuard which can be used as a future and will resolve into a Guard.

pub unsafe fn push_request(&self, req: Request)[src]

Pushes a lock request onto the queue.

pub fn get_mut(&mut self) -> Option<&mut T>[src]

Returns a mutable reference to the inner Vec if there are currently no other copies of this Qutex.

Since this call borrows the inner lock mutably, no actual locking needs to take place---the mutable borrow statically guarantees no locks exist.

pub fn as_ptr(&self) -> *const T[src]

Returns a reference to the inner value.

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

Returns a mutable reference to the inner value.

pub unsafe fn process_queue(&self)[src]

Pops the next lock request in the queue if this (the caller's) lock is unlocked.

pub unsafe fn direct_unlock(&self)[src]

Unlocks this (the caller's) lock and wakes up the next task in the queue.

Trait Implementations

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

impl<T> Clone for Qutex<T>[src]

impl<T: Debug> Debug for Qutex<T>[src]

Auto Trait Implementations

impl<T> Send for Qutex<T> where
    T: Send

impl<T> Sync for Qutex<T> where
    T: Send

impl<T> Unpin for Qutex<T>

impl<T> !UnwindSafe for Qutex<T>

impl<T> !RefUnwindSafe for Qutex<T>

Blanket Implementations

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

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

impl<T> From<T> for 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.

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

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

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