Struct rand_distr::uniform::UniformChar
source · [−]pub struct UniformChar { /* private fields */ }
Expand description
The back-end implementing UniformSampler
for char
.
Unless you are implementing UniformSampler
for your own type, this type
should not be used directly, use Uniform
instead.
This differs from integer range sampling since the range 0xD800..=0xDFFF
are used for surrogate pairs in UCS and UTF-16, and consequently are not
valid Unicode code points. We must therefore avoid sampling values in this
range.
Trait Implementations
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformChar where
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformChar where
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
Construct self, with inclusive lower bound and exclusive upper bound
[low, high)
. Read more
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformChar where
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformChar where
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
Construct self, with inclusive bounds [low, high]
. Read more
pub fn sample<R>(&self, rng: &mut R) -> <UniformChar as UniformSampler>::X where
R: Rng + ?Sized,
pub fn sample<R>(&self, rng: &mut R) -> <UniformChar as UniformSampler>::X where
R: Rng + ?Sized,
Sample a value.
fn sample_single<R, B1, B2>(low: B1, high: B2, rng: &mut R) -> Self::X where
R: Rng + ?Sized,
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
fn sample_single<R, B1, B2>(low: B1, high: B2, rng: &mut R) -> Self::X where
R: Rng + ?Sized,
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
Sample a single value uniformly from a range with inclusive lower bound
and exclusive upper bound [low, high)
. Read more
fn sample_single_inclusive<R, B1, B2>(low: B1, high: B2, rng: &mut R) -> Self::X where
R: Rng + ?Sized,
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
fn sample_single_inclusive<R, B1, B2>(low: B1, high: B2, rng: &mut R) -> Self::X where
R: Rng + ?Sized,
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
Sample a single value uniformly from a range with inclusive lower bound
and inclusive upper bound [low, high]
. Read more
Auto Trait Implementations
impl RefUnwindSafe for UniformChar
impl Send for UniformChar
impl Sync for UniformChar
impl Unpin for UniformChar
impl UnwindSafe for UniformChar
Blanket Implementations
Mutably borrows from an owned value. Read more