proptest/arbitrary/
mod.rs

1//-
2// Copyright 2017, 2018 The proptest developers
3//
4// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7// option. This file may not be copied, modified, or distributed
8// except according to those terms.
9
10//! Defines the `Arbitrary` trait and related free functions
11//! and type aliases.
12//!
13//! See the [`Arbitrary`] trait for more information.
14//!
15//! [`Arbitrary`]: trait.Arbitrary.html
16
17use crate::strategy::statics;
18use crate::strategy::{Map, Strategy};
19
20//==============================================================================
21// Trait and impls
22//==============================================================================
23
24mod traits;
25
26#[macro_use]
27pub mod functor;
28
29#[macro_use]
30mod macros;
31
32mod arrays;
33mod primitives;
34mod sample;
35mod tuples;
36
37mod _core;
38
39#[cfg(any(feature = "std", feature = "alloc"))]
40mod _alloc;
41
42#[cfg(feature = "std")]
43mod _std;
44
45pub use self::traits::*;
46
47//==============================================================================
48// SMapped + Mapped aliases to make documentation clearer.
49//==============================================================================
50
51pub(crate) type SFnPtrMap<S, O> =
52    statics::Map<S, fn(<S as Strategy>::Value) -> O>;
53
54/// A static map from a strategy of `I` to `O`.
55///
56/// # Stability
57///
58/// This is provided to make documentation more readable.
59/// Do not rely on it existing in your own code.
60pub type SMapped<I, O> = statics::Map<StrategyFor<I>, fn(I) -> O>;
61
62/// A normal map from a strategy of `I` to `O`.
63///
64/// # Stability
65///
66/// This is provided to make documentation more readable.
67/// Do not rely on it existing in your own code.
68pub type Mapped<I, O> = Map<StrategyFor<I>, fn(I) -> O>;