[−][src]Struct bastion_qutex::Qutex
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,
T: Send,
impl<T> Sync for Qutex<T> where
T: Send,
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]
U: From<T>,
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,