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())].

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

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default. Read more

The type of Strategy used to generate values of type Self. Read more

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.