Struct oncemutex::OnceMutex [] [src]

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

A mutex which can only be locked once, but which provides very fast, lock-free, concurrent reads after the first lock is over.

Methods

impl<T: Send + Sync> OnceMutex<T>
[src]

Create a new OnceMutex.

Attempt to lock the OnceMutex.

This will not block, but will return None if the OnceMutex has already been locked or is currently locked by another thread.

Block the current task until the first lock is over.

Does nothing if there is no lock.

Extract the data from a OnceMutex.

Is this OnceMutex currently locked?

Trait Implementations

impl<T: Send> Send for OnceMutex<T>
[src]

impl<T: Sync> Sync for OnceMutex<T>
[src]

impl<T: Send + Sync> Deref for OnceMutex<T>
[src]

The resulting type after dereferencing

Get a reference to the value inside the OnceMutex.

This can block if the OnceMutex is in its lock, but is very fast otherwise.

impl<T: Send + Sync> DerefMut for OnceMutex<T>
[src]

The method called to mutably dereference a value