Module tower::util::rng

source ·
Expand description

PRNG utilities for tower middleware.

This module provides a generic Rng trait and a HasherRng that implements the trait based on RandomState or any other Hasher.

These utilities replace tower’s internal usage of rand with these smaller, more lightweight methods. Most of the implementations are extracted from their corresponding rand implementations.

Structs§

  • A Rng implementation that uses a Hasher to generate the random values. The implementation uses an internal counter to pass to the hasher for each iteration of Rng::next_u64.

Traits§

  • A simple PRNG trait for use within tower middleware.