Struct diem_proptest_helpers::Index
source · pub struct Index(_);
Expand description
Wrapper for proptest
’s [Index
][proptest::sample::Index] that allows AsRef
to work.
There is no blanket impl<T> AsRef<T> for T
, so &[PropIndex]
doesn’t work with
&[impl AsRef<PropIndex>]
(unless an impl gets added upstream). Index
does.
Methods from Deref<Target = PropIndex>§
pub fn index(&self, size: usize) -> usize
pub fn index(&self, size: usize) -> usize
Return the real index that would be used to index a collection of size size
.
Panics
Panics if size == 0
.
Trait Implementations§
source§impl Arbitrary for Index
impl Arbitrary for Index
§type Parameters = <Index as Arbitrary>::Parameters
type Parameters = <Index as Arbitrary>::Parameters
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<<Index as Arbitrary>::Strategy, fn(_: Index) -> Index>
type Strategy = Map<<Index as Arbitrary>::Strategy, fn(_: Index) -> Index>
The type of
Strategy
used to generate values of type Self
.