# [−] [src] Trait rand_core::block::BlockRngCore

    pub trait BlockRngCore {
        type Item;
        type Results: AsRef<[Self::Item]> + AsMut<[Self::Item]> + Default;
        fn generate(&mut self, results: &mut Self::Results);
    }

A trait for RNGs which do not generate random numbers individually, but in blocks (typically `[u32; N]`). This technique is commonly used by cryptographic RNGs to improve performance.

See the [module][crate::block] documentation for details.

## Associated Types

### `type Item`

Results element type, e.g. `u32`.

### `type Results: AsRef<[Self::Item]> + AsMut<[Self::Item]> + Default`

Results type. This is the 'block' an RNG implementing `BlockRngCore` generates, which will usually be an array like `[u32; 16]`.

Loading content...

## Required methods

### `fn generate(&mut self, results: &mut Self::Results)`

Generate a new block of results.

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