Struct diem_proptest_helpers::Index [−][src]
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>
Return the real index that would be used to index a collection of size size.
Panics
Panics if size == 0.
Return a reference to the element in slice that this Index refers to.
A shortcut for &slice[index.index(slice.len())].
pub fn get_mut<T>(&self, slice: &'a mut [T]) -> &'a mut T
pub fn get_mut<T>(&self, slice: &'a mut [T]) -> &'a mut T
Return a mutable reference to the element in slice that this Index
refers to.
A shortcut for &mut slice[index.index(slice.len())].
Trait Implementations
type Parameters = <PropIndex as Arbitrary>::Parameters
type Parameters = <PropIndex as Arbitrary>::Parameters
The type of parameters that arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default. Read more
Auto Trait Implementations
impl RefUnwindSafe for Index
impl UnwindSafe for Index
Blanket Implementations
Mutably borrows from an owned value. Read more