[][src]Struct rltk::BACKEND

pub struct BACKEND { /* fields omitted */ }

Methods from Deref<Target = Mutex<RawMutex, PlatformGL>>

pub fn lock(&self) -> MutexGuard<R, T>

Acquires a mutex, blocking the current thread until it is able to do so.

This function will block the local thread until it is available to acquire the mutex. Upon returning, the thread is the only thread with the mutex held. An RAII guard is returned to allow scoped unlock of the lock. When the guard goes out of scope, the mutex will be unlocked.

Attempts to lock a mutex in the thread which already holds the lock will result in a deadlock.

pub fn try_lock(&self) -> Option<MutexGuard<R, T>>

Attempts to acquire this lock.

If the lock could not be acquired at this time, then None is returned. Otherwise, an RAII guard is returned. The lock will be unlocked when the guard is dropped.

This function does not block.

pub unsafe fn force_unlock(&self)

Forcibly unlocks the mutex.

This is useful when combined with mem::forget to hold a lock without the need to maintain a MutexGuard object alive, for example when dealing with FFI.

Safety

This method must only be called if the current thread logically owns a MutexGuard but that guard has be discarded using mem::forget. Behavior is undefined if a mutex is unlocked when not locked.

pub unsafe fn raw(&self) -> &R

Returns the underlying raw mutex object.

Note that you will most likely need to import the RawMutex trait from lock_api to be able to call functions on the raw mutex.

Safety

This method is unsafe because it allows unlocking a mutex while still holding a reference to a MutexGuard.

pub unsafe fn force_unlock_fair(&self)

Forcibly unlocks the mutex using a fair unlock procotol.

This is useful when combined with mem::forget to hold a lock without the need to maintain a MutexGuard object alive, for example when dealing with FFI.

Safety

This method must only be called if the current thread logically owns a MutexGuard but that guard has be discarded using mem::forget. Behavior is undefined if a mutex is unlocked when not locked.

pub fn try_lock_for(
    &self,
    timeout: <R as RawMutexTimed>::Duration
) -> Option<MutexGuard<R, T>>

Attempts to acquire this lock until a timeout is reached.

If the lock could not be acquired before the timeout expired, then None is returned. Otherwise, an RAII guard is returned. The lock will be unlocked when the guard is dropped.

pub fn try_lock_until(
    &self,
    timeout: <R as RawMutexTimed>::Instant
) -> Option<MutexGuard<R, T>>

Attempts to acquire this lock until a timeout is reached.

If the lock could not be acquired before the timeout expired, then None is returned. Otherwise, an RAII guard is returned. The lock will be unlocked when the guard is dropped.

Trait Implementations

impl Deref for BACKEND[src]

type Target = Mutex<RawMutex, PlatformGL>

The resulting type after dereferencing.

impl LazyStatic for BACKEND[src]

Auto Trait Implementations

impl RefUnwindSafe for BACKEND

impl Send for BACKEND

impl Sync for BACKEND

impl Unpin for BACKEND

impl UnwindSafe for BACKEND

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