# [−][src]Trait crossbeam::atomic::AtomicConsume

    pub trait AtomicConsume {
        type Val;
        fn load_consume(&self) -> Self::Val;
    }

Trait which allows reading from primitive atomic types with "consume" ordering.

## Associated Types

### `type Val`

Type returned by `load_consume`.

Loading content...

## Required methods

### `fn load_consume(&self) -> Self::Val`

Loads a value from the atomic using a "consume" memory ordering.

This is similar to the "acquire" ordering, except that an ordering is only guaranteed with operations that "depend on" the result of the load. However consume loads are usually much faster than acquire loads on architectures with a weak memory model since they don't require memory fence instructions.

The exact definition of "depend on" is a bit vague, but it works as you would expect in practice since a lot of software, especially the Linux kernel, rely on this behavior.

This is currently only implemented on ARM and AArch64, where a fence can be avoided. On other architectures this will fall back to a simple `load(Ordering::Acquire)`.

Loading content...

## Implementations on Foreign Types

### `impl<T> AtomicConsume for AtomicPtr<T>`[src]

#### `type Val = *mut T`

#### `fn load_consume(&self) -> <AtomicPtr<T> as AtomicConsume>::Val`[src]

### `impl AtomicConsume for AtomicUsize`[src]

#### `type Val = usize`

#### `fn load_consume(&self) -> <AtomicUsize as AtomicConsume>::Val`[src]

### `impl AtomicConsume for AtomicBool`[src]

#### `type Val = bool`

#### `fn load_consume(&self) -> <AtomicBool as AtomicConsume>::Val`[src]

### `impl AtomicConsume for AtomicIsize`[src]

#### `type Val = isize`

#### `fn load_consume(&self) -> <AtomicIsize as AtomicConsume>::Val`[src]

Loading content...

## Implementors

Loading content...

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