Struct rand::distributions::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
sourceimpl Clone for UniformChar
impl Clone for UniformChar
sourcefn clone(&self) -> UniformChar
fn clone(&self) -> UniformChar
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UniformChar
impl Debug for UniformChar
sourceimpl UniformSampler for UniformChar
impl UniformSampler for UniformChar
sourcefn new<B1, B2>(low_b: B1, high_b: B2) -> Self where
B1: SampleBorrow<Self::X> + Sized,
B2: SampleBorrow<Self::X> + Sized,
fn new<B1, B2>(low_b: B1, high_b: B2) -> Self where
B1: SampleBorrow<Self::X> + Sized,
B2: SampleBorrow<Self::X> + Sized,
Construct self, with inclusive lower bound and exclusive upper bound
[low, high)
. Read more
sourcefn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> Self where
B1: SampleBorrow<Self::X> + Sized,
B2: SampleBorrow<Self::X> + Sized,
fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> Self where
B1: SampleBorrow<Self::X> + Sized,
B2: SampleBorrow<Self::X> + Sized,
Construct self, with inclusive bounds [low, high]
. Read more
sourcefn sample_single<R: Rng + ?Sized, B1, B2>(
low: B1,
high: B2,
rng: &mut R
) -> Self::X where
B1: SampleBorrow<Self::X> + Sized,
B2: SampleBorrow<Self::X> + Sized,
fn sample_single<R: Rng + ?Sized, B1, B2>(
low: B1,
high: B2,
rng: &mut R
) -> Self::X where
B1: SampleBorrow<Self::X> + Sized,
B2: SampleBorrow<Self::X> + Sized,
Sample a single value uniformly from a range with inclusive lower bound
and exclusive upper bound [low, high)
. Read more
sourcefn sample_single_inclusive<R: Rng + ?Sized, B1, B2>(
low: B1,
high: B2,
rng: &mut R
) -> Self::X where
B1: SampleBorrow<Self::X> + Sized,
B2: SampleBorrow<Self::X> + Sized,
fn sample_single_inclusive<R: Rng + ?Sized, B1, B2>(
low: B1,
high: B2,
rng: &mut R
) -> Self::X where
B1: SampleBorrow<Self::X> + Sized,
B2: SampleBorrow<Self::X> + Sized,
Sample a single value uniformly from a range with inclusive lower bound
and inclusive upper bound [low, high]
. Read more
impl Copy for UniformChar
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more