1 <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Convenience re-export of common members"><title>bdk_chain::bitcoin::secp256k1::rand::prelude - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-5d1d17d0.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="bdk_chain" data-themes="" data-resource-suffix="" data-rustdoc-version="1.86.0-nightly (f3d1d47fd 2025-01-20)" data-channel="nightly" data-search-js="search-ccb196c1.js" data-settings-js="settings-0f613d39.js" ><script src="../../../../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../../../../bdk_chain/index.html"><img src="https://github.com/bitcoindevkit/bdk/raw/master/static/bdk.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../../../../bdk_chain/index.html"><img src="https://github.com/bitcoindevkit/bdk/raw/master/static/bdk.png" alt="logo"></a><h2><a href="../../../../../bdk_chain/index.html">bdk_<wbr>chain</a><span class="version">0.21.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module prelude</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In bdk_<wbr>chain::<wbr>bitcoin::<wbr>secp256k1::<wbr>rand</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../../../../index.html">bdk_chain</a>::<wbr><a href="../../../index.html">bitcoin</a>::<wbr><a href="../../index.html">secp256k1</a>::<wbr><a href="../index.html">rand</a></span><h1>Module <span>prelude</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="https://rust-random.github.io/rand/src/rand/lib.rs.html#98">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Convenience re-export of common members</p>
2 <p>Like the standard library’s prelude, this module simplifies importing of
3 common items. Unlike the standard prelude, the contents of this module must
4 be imported manually:</p>
6 <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>rand::prelude::<span class="kw-2">*</span>;</code></pre></div>
7 </div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.StdRng.html" title="struct bdk_chain::bitcoin::secp256k1::rand::prelude::StdRng">StdRng</a></dt><dd>The standard RNG. The PRNG algorithm in <code>StdRng</code> is chosen to be efficient
8 on the current platform, to be statistically strong and unpredictable
9 (meaning a cryptographically secure PRNG).</dd><dt><a class="struct" href="struct.ThreadRng.html" title="struct bdk_chain::bitcoin::secp256k1::rand::prelude::ThreadRng">Thread<wbr>Rng</a></dt><dd>A reference to the thread-local generator</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.CryptoRng.html" title="trait bdk_chain::bitcoin::secp256k1::rand::prelude::CryptoRng">Crypto<wbr>Rng</a></dt><dd>A marker trait used to indicate that an <a href="../trait.RngCore.html" title="trait bdk_chain::bitcoin::secp256k1::rand::RngCore"><code>RngCore</code></a> or <a href="https://rust-random.github.io/rand/rand_core/block/trait.BlockRngCore.html" title="trait rand_core::block::BlockRngCore"><code>BlockRngCore</code></a>
10 implementation is supposed to be cryptographically secure.</dd><dt><a class="trait" href="trait.Distribution.html" title="trait bdk_chain::bitcoin::secp256k1::rand::prelude::Distribution">Distribution</a></dt><dd>Types (distributions) that can be used to create a random instance of <code>T</code>.</dd><dt><a class="trait" href="trait.IteratorRandom.html" title="trait bdk_chain::bitcoin::secp256k1::rand::prelude::IteratorRandom">Iterator<wbr>Random</a></dt><dd>Extension trait on iterators, providing random sampling methods.</dd><dt><a class="trait" href="trait.Rng.html" title="trait bdk_chain::bitcoin::secp256k1::rand::prelude::Rng">Rng</a></dt><dd>An automatically-implemented extension trait on <a href="../trait.RngCore.html" title="trait bdk_chain::bitcoin::secp256k1::rand::RngCore"><code>RngCore</code></a> providing high-level
11 generic methods for sampling values and other convenience methods.</dd><dt><a class="trait" href="trait.RngCore.html" title="trait bdk_chain::bitcoin::secp256k1::rand::prelude::RngCore">RngCore</a></dt><dd>The core of a random number generator.</dd><dt><a class="trait" href="trait.SeedableRng.html" title="trait bdk_chain::bitcoin::secp256k1::rand::prelude::SeedableRng">Seedable<wbr>Rng</a></dt><dd>A random number generator that can be explicitly seeded.</dd><dt><a class="trait" href="trait.SliceRandom.html" title="trait bdk_chain::bitcoin::secp256k1::rand::prelude::SliceRandom">Slice<wbr>Random</a></dt><dd>Extension trait on slices, providing random mutation and sampling methods.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.random.html" title="fn bdk_chain::bitcoin::secp256k1::rand::prelude::random">random</a></dt><dd>Generates a random value using the thread-local random number generator.</dd><dt><a class="fn" href="fn.thread_rng.html" title="fn bdk_chain::bitcoin::secp256k1::rand::prelude::thread_rng">thread_<wbr>rng</a></dt><dd>Retrieve the lazily-initialized thread-local random number generator,
12 seeded by the system. Intended to be used in method chaining style,
13 e.g. <code>thread_rng().gen::<i32>()</code>, or cached locally, e.g.
14 <code>let mut rng = thread_rng();</code>. Invoked by the <code>Default</code> trait, making
15 <code>ThreadRng::default()</code> equivalent.</dd></dl></section></div></main></body></html>