pub fn lock(&self) -> VaultAcquire<T> {
    VaultAcquire {
      inner: self.inner.clone()
    }
  }
/// Lock the `Vault` for future access to its data.
/// This operation does not block and will return a
/// `VaultAcquire` object, which is a future that
/// resolves to a `VaultAcquired` object. Once the future
/// has resolved, we are able to access the underlying
/// data of the `Vault`.
///
/// # Example
///
/// ```
/// # extern crate futures;
/// # extern crate popcorn;
/// #
/// # use popcorn::vault::*;
/// # use futures::Future;
/// #
/// # fn main() {
/// // Create a new Vault containing a double
/// let vault: Vault<f64> = Vault::new(42.0);
///
/// // Acquire a future lock on the data
/// let acquire = vault.lock();
///
/// // Wait until we have locked the data
/// let acquired = vault.try_lock().unwrap();
///
/// // Access the value in the vault
/// let value: f64 = *acquired;
/// #
/// # assert_eq!(value, 42.0);
/// # }
/// ```
Lock the `Vault` for future access to its data.
This operation does not block and will return a
`VaultAcquire` object, which is a future that
resolves to a `VaultAcquired` object. Once the future
has resolved, we are able to access the underlying
data of the `Vault`.
Lock the ` Vault ` for future access to its data . This operation does not block and will return a ` VaultAcquire ` object which is a future that resolves to a ` VaultAcquired ` object . Once the future has resolved we are able to access the underlying data of the ` Vault ` .
pub fn lock(&self) -> VaultAcquire<T> {
    VaultAcquire {
      inner: self.inner.clone()
    }
  }
pub fn lock ( & self ) -> VaultAcquire < T > { VaultAcquire { inner : self . inner . clone ( ) } }
Lock the `Vault` for future access to its data.
Lock the ` Vault ` for future access to its data .
&self
&self
example
None
extern crate futures;
None
extern crate popcorn;
None
use popcorn::vault::*;
None
use futures::future;
None
fn main() {
Create a new Vault containing a double
let vault: Vault = Vault::new(42.0).

Acquire a future lock on the data
let acquire = vault.lock().

Wait until we have locked the data
let acquired = vault.try_lock().unwrap().

Access the value in the vault
let value: f64 = *acquired.
Create a new Vault containing a double let vault : Vault = Vault :: new ( 42 . 0 ) . Acquire a future lock on the data let acquire = vault . lock () . Wait until we have locked the data let acquired = vault . try_lock () . unwrap () . Access the value in the vault let value : f64 = * acquired .
assert_eq!(value, 42.0);
None
}
None