Struct diem_proptest_helpers::Index
source · pub struct Index(/* private fields */);
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
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
impl Copy for Index
Auto Trait Implementations§
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnwindSafe for Index
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more