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§
Source§impl Clone for UniformChar
impl Clone for UniformChar
Source§fn clone(&self) -> UniformChar
fn clone(&self) -> UniformChar
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UniformChar
impl Debug for UniformChar
Source§impl<'de> Deserialize<'de> for UniformChar
impl<'de> Deserialize<'de> for UniformChar
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UniformChar, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UniformChar, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for UniformChar
impl PartialEq for UniformChar
Source§impl Serialize for UniformChar
impl Serialize for UniformChar
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl UniformSampler for UniformChar
impl UniformSampler for UniformChar
Source§fn new<B1, B2>(low_b: B1, high_b: B2) -> Result<UniformChar, Error>where
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
fn new<B1, B2>(low_b: B1, high_b: B2) -> Result<UniformChar, Error>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 moreSource§fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> Result<UniformChar, Error>where
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> Result<UniformChar, Error>where
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
Construct self, with inclusive bounds
[low, high]
. Read moreSource§fn sample<R>(&self, rng: &mut R) -> <UniformChar as UniformSampler>::X
fn sample<R>(&self, rng: &mut R) -> <UniformChar as UniformSampler>::X
Sample a value.
Source§fn sample_single<R, B1, B2>(
low: B1,
high: B2,
rng: &mut R,
) -> Result<Self::X, Error>
fn sample_single<R, B1, B2>( low: B1, high: B2, rng: &mut R, ) -> Result<Self::X, Error>
Sample a single value uniformly from a range with inclusive lower bound
and exclusive upper bound
[low, high)
. Read moreimpl Copy for UniformChar
impl Eq for UniformChar
impl StructuralPartialEq for UniformChar
Auto Trait Implementations§
impl Freeze for UniformChar
impl RefUnwindSafe for UniformChar
impl Send for UniformChar
impl Sync for UniformChar
impl Unpin for UniformChar
impl UnwindSafe for UniformChar
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more