From 1d0410c644cd0d1d74ea1095c7aefb91159c1302 Mon Sep 17 00:00:00 2001 From: dhardy Date: Sun, 28 Apr 2024 17:06:38 +0000 Subject: [PATCH] deploy: 93b37df197ecbb5247251a7c30ef08840c818d4c --- 404.html | 2 +- contrib-bench.html | 2 +- contrib-doc.html | 2 +- contrib-scope.html | 2 +- contrib-test.html | 2 +- contributing.html | 2 +- crates-rand.html => crate-features.html | 62 ++-- crates-gen.html => crate-platforms.html | 47 +-- guide-cargo.html => crate-reprod.html | 95 +++--- crates.html | 97 +++--- guide-data.html | 6 +- guide-dist.html | 2 +- guide-err.html | 6 +- guide-gen.html | 4 +- guide-parallel.html | 10 +- guide-process.html | 2 +- guide-rngs.html | 23 +- guide-seeding.html | 2 +- guide-seq.html | 2 +- guide-start.html | 120 +++----- guide-values.html | 2 +- guide.html | 11 +- index.html | 12 +- intro.html | 12 +- portability.html | 294 +----------------- print.html | 380 ++++++++++++------------ quick-start.html | 313 +++++++++++++++++++ searchindex.js | 2 +- searchindex.json | 2 +- update-0.5.html | 2 +- update-0.6.html | 2 +- update-0.7.html | 2 +- update-0.8.html | 4 +- update.html | 6 +- 34 files changed, 757 insertions(+), 777 deletions(-) rename crates-rand.html => crate-features.html (58%) rename crates-gen.html => crate-platforms.html (60%) rename guide-cargo.html => crate-reprod.html (53%) create mode 100644 quick-start.html diff --git a/404.html b/404.html index fb730c9..d1c896e 100644 --- a/404.html +++ b/404.html @@ -97,7 +97,7 @@ diff --git a/contrib-bench.html b/contrib-bench.html index 681d29f..410d80b 100644 --- a/contrib-bench.html +++ b/contrib-bench.html @@ -95,7 +95,7 @@ diff --git a/contrib-doc.html b/contrib-doc.html index a163b38..4de85e9 100644 --- a/contrib-doc.html +++ b/contrib-doc.html @@ -95,7 +95,7 @@ diff --git a/contrib-scope.html b/contrib-scope.html index 0f73952..f494da2 100644 --- a/contrib-scope.html +++ b/contrib-scope.html @@ -95,7 +95,7 @@ diff --git a/contrib-test.html b/contrib-test.html index 9165e0e..4dc5b10 100644 --- a/contrib-test.html +++ b/contrib-test.html @@ -95,7 +95,7 @@ diff --git a/contributing.html b/contributing.html index ff167d7..0cdd84c 100644 --- a/contributing.html +++ b/contributing.html @@ -95,7 +95,7 @@ diff --git a/crates-rand.html b/crate-features.html similarity index 58% rename from crates-rand.html rename to crate-features.html index 1697b55..744a909 100644 --- a/crates-rand.html +++ b/crate-features.html @@ -3,7 +3,7 @@ - Rand and co - The Rust Rand Book + Features - The Rust Rand Book @@ -95,7 +95,7 @@ @@ -163,49 +163,37 @@

The Rust Rand Book

-

Rand and co

-

rand_core (API)

-

The rand_core crate defines the core traits implemented by RNGs. This exists -as a separate crate with two purposes:

+

Crate features

+

For definitive documentation of crate features, check the crate release's Cargo.toml:

-

The RngCore, SeedableRng, CryptoRng traits and Error type are -all defined by this crate and re-exported by the rand crate.

-

rand (primary interface)

-

The rand crate is optimised for easy usage of common random-number -functionality. This has several aspects:

+

Common features

+

The following features are common to rand_core, rand, rand_distr and potentially some RNG crates:

    -
  • the rngs module provides a few convenient generators
  • -
  • the distributions module concerns sampling of random values
  • -
  • the seq module concerns sampling from and shuffling sequences
  • -
  • the Rng trait provides a few convenience methods for generating -random values
  • -
  • the random function provides convenient generation in a single call
  • +
  • std: opt into functionality dependent on the std lib. This is default-enabled except in rand_core; for no_std usage, use default-features = false.
  • +
  • alloc: enables functionality requiring an allocator (for usage with no_std). This is implied by std.
  • +
  • serde1: enables serialization via [serde], version 1.0.
-

Feature flags

-

Besides the common feature flags, several aspects are configurable:

+

Rand features

+

Additional rand features:

    -
  • small_rng enables the SmallRng generator (feature-gated since v0.7)
  • -
  • simd_support enables experimental (nightly-only) support for generating -SIMD values
  • +
  • small_rng enables the SmallRng generator (feature-gated since v0.7).
  • +
  • simd_support: Experimental support for generating various SIMD types (requires nightly rustc).
  • +
  • log enables a few log messages via [log].

Note regarding SIMD: the above flag concerns explicit generation of SIMD types only and not optimisation. SIMD operations may be used internally regardless of this flag; e.g. the ChaCha generator has explicit support for SIMD operations internally.

-

Distributions

-

The rand crate only implements sampling from the most common random -number distributions: uniform and weighted sampling. For everything else,

-
    -
  • rand_distr provides fast sampling from a variety of other distributions, -including Normal (Gauss), Binomial, Poisson, UnitCircle, and many more
  • -
  • statrs is a port of the C# Math.NET library, implementing many of the -same distributions (plus/minus a few), along with PDF and CDF functions, -the error, beta, gamma and logistic special functions, plus a few -utilities. (For clarity, statrs is not part of the Rand library.)
  • -
+

rand_distr features

+

The floating point functions from num_traits and libm are used to support +no_std environments and ensure reproducibility. If the floating point +functions from std are preferred, which may provide better accuracy and +performance but may produce different random values, the std_math feature +can be enabled. (Note that any other crate depending on num-traits's std feature (default-enabled) will have the same effect.)

@@ -218,7 +206,7 @@

Distributions - @@ -236,7 +224,7 @@

Distributions - diff --git a/crates-gen.html b/crate-platforms.html similarity index 60% rename from crates-gen.html rename to crate-platforms.html index 50cfb28..84e174a 100644 --- a/crates-gen.html +++ b/crate-platforms.html @@ -3,7 +3,7 @@ - Random generators - The Rust Rand Book + Platform support - The Rust Rand Book @@ -95,7 +95,7 @@ @@ -163,50 +163,31 @@

The Rust Rand Book

-

Random Generators

-

Getrandom

+

Platform support

+

Thanks to many community contributions, Rand crates support a wide variety of platforms.

+

no_std

+

With default-features = false, both rand and rand_distr support no_std builds. See Common features.

+

getrandom

The getrandom crate provides a low-level API around platform-specific random-number sources, and is an important building block of rand and rand_core as well as a number of cryptography libraries. It is not intended for usage outside of low-level libraries.

-

In some cases, particularly when targeting WASM, end-users may need to -configure this crate. -Consult the getrandom documentation for the relevant version.

-

CPU Jitter

-

The rand_jitter crate implements a CPU-jitter-based entropy harvester which -may be used to provide an alternative source of entropy where a high-resolution -CPU timer is available.

-

It should be noted that CPU-jitter harvesters may be prone to side-channel -attacks and that this -implementation is quite slow (due to conservative estimates of entropy gained -per step).

-

In prior versions of rand this was a direct dependency, used -automatically when other sources of entropy failed. -In current versions it is not a dependency (not even an optional one).

-

Deterministic generators

-

The following crates implement pseudo-random number generators -(see Our RNGs):

-
    -
  • rand_chacha provides generators using the ChaCha cipher
  • -
  • rand_hc implements a generator using the HC-128 cipher
  • -
  • rand_isaac implements the ISAAC generators
  • -
  • rand_pcg implements a small selection of PCG generators
  • -
  • rand_xoshiro implements the SplitMix and Xoshiro generators
  • -
  • rand_xorshift implements the basic Xorshift generator
  • -
+

WebAssembly

+

The wasm32-unknown-unknown target does not make any assumptions about which JavaScript interface is available, thus the getrandom crate requires configuration. See WebAssembly support.

+

Note that the wasm32-wasi and wasm32-unknown-emscripten targets do not have this limitation.