# [−][src]Struct lazycell::AtomicLazyCell

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

A lazily filled and thread-safe `Cell`, with frozen contents.

## Methods

### `impl<T> AtomicLazyCell<T>`[src]

#### `pub const NONE: Self`[src]

An empty `AtomicLazyCell`.

#### `pub fn new() -> AtomicLazyCell<T>`[src]

Creates a new, empty, `AtomicLazyCell`.

#### `pub fn fill(&self, t: T) -> Result<(), T>`[src]

Put a value into this cell.

This function will return `Err(value)` is the cell is already full.

#### `pub fn replace(&mut self, value: T) -> Option<T>`[src]

Put a value into this cell.

Note that this function is infallible but requires `&mut self`. By requiring `&mut self` we're guaranteed that no active borrows to this cell can exist so we can always fill in the value. This may not always be usable, however, as `&mut self` may not be possible to borrow.

# Return value

This function returns the previous value, if any.

#### `pub fn filled(&self) -> bool`[src]

Test whether this cell has been previously filled.

#### `pub fn borrow(&self) -> Option<&T>`[src]

Borrows the contents of this lazy cell for the duration of the cell itself.

This function will return `Some` if the cell has been previously initialized, and `None` if it has not yet been initialized.

#### `pub fn into_inner(self) -> Option<T>`[src]

Consumes this `LazyCell`, returning the underlying value.

### `impl<T: Copy> AtomicLazyCell<T>`[src]

#### `pub fn get(&self) -> Option<T>`[src]

Returns a copy of the contents of the lazy cell.

This function will return `Some` if the cell has been previously initialized, and `None` if it has not yet been initialized.

## Trait Implementations

### `impl<T: Debug> Debug for AtomicLazyCell<T>`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`[src]

Formats the value using the given formatter. Read more

### `impl<T: Send> Send for AtomicLazyCell<T>`[src]

### `impl<T: Sync + Send> Sync for AtomicLazyCell<T>`[src]

### `impl<T: Clone> Clone for AtomicLazyCell<T>`[src]

#### `fn clone(&self) -> AtomicLazyCell<T>`[src]

Create a clone of this `AtomicLazyCell`

If self has not been initialized, returns an uninitialized `AtomicLazyCell` otherwise returns an `AtomicLazyCell` already initialized with a clone of the contents of self.

#### `fn clone_from(&mut self, source: &Self)`1.0.0[src]

Performs copy-assignment from `source`. Read more

### `impl<T: Default> Default for AtomicLazyCell<T>`[src]

#### `fn default() -> AtomicLazyCell<T>`[src]

Returns the "default value" for a type. Read more

## Auto Trait Implementations

### `impl<T> Unpin for AtomicLazyCell<T> where
T: Unpin,`

## Blanket Implementations

### `impl<T> From<T> for T`[src]

#### `fn from(t: T) -> T`[src]

Performs the conversion.

### `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.

#### `fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`[src]

Performs the conversion.

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

#### `fn into(self) -> U`[src]

Performs the conversion.

### `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.

#### `fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`[src]

Performs the conversion.

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

#### `fn borrow(&self) -> &T`[src]

Immutably borrows from an owned value. Read more

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

#### `fn borrow_mut(&mut self) -> &mut T`[src]

Mutably borrows from an owned value. Read more

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

#### `fn type_id(&self) -> TypeId`[src]

Gets the `TypeId` of `self`. Read more

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)