Randomness¶
Draw methods are non-partial. During replay, if the recorded choice sequence is exhausted or a type mismatch is detected, draw methods fall back to fresh generation and the runner detects it.
Integer methods generate values in the closed interval [min, max].
Floating-point methods scale onto [min, max]; min is always reachable,
max is an approximate upper bound due to floating-point rounding.
Constructors¶
create¶
Parameters¶
Returns¶
- Randomness ref^
Public Functions¶
u8¶
Generate a U8 in closed interval [min, max].
Parameters¶
Returns¶
- U8 val
u16¶
Generate a U16 in closed interval [min, max].
Parameters¶
Returns¶
- U16 val
u32¶
Generate a U32 in closed interval [min, max].
Parameters¶
Returns¶
- U32 val
u64¶
Generate a U64 in closed interval [min, max].
Parameters¶
Returns¶
- U64 val
u128¶
Generate a U128 in closed interval [min, max].
Parameters¶
Returns¶
- U128 val
ulong¶
Generate a ULong in closed interval [min, max].
Parameters¶
Returns¶
- ULong val
usize¶
Generate a USize in closed interval [min, max].
Parameters¶
Returns¶
- USize val
i8¶
Generate an I8 in closed interval [min, max].
Parameters¶
Returns¶
- I8 val
i16¶
Generate an I16 in closed interval [min, max].
Parameters¶
Returns¶
- I16 val
i32¶
Generate an I32 in closed interval [min, max].
Parameters¶
Returns¶
- I32 val
i64¶
Generate an I64 in closed interval [min, max].
Parameters¶
Returns¶
- I64 val
i128¶
Generate an I128 in closed interval [min, max].
Parameters¶
Returns¶
- I128 val
ilong¶
Generate an ILong in closed interval [min, max].
Parameters¶
Returns¶
- ILong val
isize¶
Generate an ISize in closed interval [min, max].
Parameters¶
Returns¶
- ISize val
f32¶
Generate an F32 in the range from min to max.
Parameters¶
Returns¶
- F32 val
f64¶
Generate an F64 in the range from min to max.
Parameters¶
Returns¶
- F64 val
bool¶
Generate a random Bool value.
Returns¶
- Bool val
forced_bool¶
Record a predetermined Bool. This choice is excluded from shrinking. Use when the outcome is fixed by the generator's structure (e.g., elements below a collection minimum).
Parameters¶
- value: Bool val
Returns¶
- Bool val
shuffle[T: T]¶
Shuffle the array in place using Fisher-Yates, recording one integer choice per element as the swap index.
Parameters¶
- array: Array[T] ref
Returns¶
- None val ?
start_span¶
Mark the beginning of a structural span in the choice sequence. Spans let the shrinker understand generator structure — for example, which choices belong to a single collection element.
Parameters¶
- label: SpanLabel
Returns¶
- None val
end_span¶
Close the most recently opened span. If discard is true, the span
is marked as discarded (e.g., a filter rejection).
Errors if no span is open (mismatched start_span/end_span calls).
Parameters¶
- discard: Bool val = false
Returns¶
- None val ?