Cargo Features

[dependencies]
rand_distr = { version = "0.5.0-alpha.3", default-features = false, features = ["std", "alloc", "std_math", "serde", "serde_with"] }
default = std

The std feature is set by default whenever rand_distr is added without default-features = false somewhere in the dependency tree.

std default = alloc

Enables std of rand

For inline examples

alloc std

Enables alloc of rand

Affects rand_distr::weighted_alias, rand_distr::weighted_tree

std_math

Use std's floating-point arithmetic instead of libm. Note that any other crate depending on num-traits's std feature (default-enabled) will have the same effect.

Enables std of num-traits

serde

Enables serde, serde of rand

Features from optional dependencies

serde_with implicit feature

Enables serde_with

serde_with:

Custom de/serialization functions for Rust's serde