Skip to main content

SampleRange

Trait SampleRange 

Source
pub trait SampleRange: Sealed {
    type Output;
}
Expand description

A range Rng::random_range can sample.

Implemented for Range and RangeInclusive of f32, f64, and the integer types u8..u64, usize, i8..i64, isize. Sealed on purpose: which primitive a range draws from, and how many draws it takes, is part of the replay contract, so it is not something a game may redefine.

Required Associated Types§

Source

type Output

The sampled value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SampleRange for Range<f32>

Source§

impl SampleRange for Range<f64>

Source§

impl SampleRange for Range<i8>

Source§

impl SampleRange for Range<i16>

Source§

impl SampleRange for Range<i32>

Source§

impl SampleRange for Range<i64>

Source§

impl SampleRange for Range<isize>

Source§

impl SampleRange for Range<u8>

Source§

impl SampleRange for Range<u16>

Source§

impl SampleRange for Range<u32>

Source§

impl SampleRange for Range<u64>

Source§

impl SampleRange for Range<usize>

Source§

impl SampleRange for RangeInclusive<f32>

Source§

impl SampleRange for RangeInclusive<f64>

Source§

impl SampleRange for RangeInclusive<i8>

Source§

impl SampleRange for RangeInclusive<i16>

Source§

impl SampleRange for RangeInclusive<i32>

Source§

impl SampleRange for RangeInclusive<i64>

Source§

impl SampleRange for RangeInclusive<isize>

Source§

impl SampleRange for RangeInclusive<u8>

Source§

impl SampleRange for RangeInclusive<u16>

Source§

impl SampleRange for RangeInclusive<u32>

Source§

impl SampleRange for RangeInclusive<u64>

Source§

impl SampleRange for RangeInclusive<usize>

Implementors§