Struct UniformChar

pub struct UniformChar { /* private fields */ }

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

impl Clone for UniformChar

fn clone(&self) -> UniformChar

impl Copy for UniformChar

impl Debug for UniformChar

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Eq for UniformChar

impl PartialEq for UniformChar

fn eq(&self, other: &UniformChar) -> bool

impl Serialize for UniformChar

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where
    __S: Serializer,

impl StructuralPartialEq for UniformChar

impl UniformSampler for UniformChar

type X = char;
fn new<B1, B2>(low_b: B1, high_b: B2) -> Result<Self, Error>
where
    B1: SampleBorrow<Self::X> + Sized,
    B2: SampleBorrow<Self::X> + Sized,
fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> Result<Self, Error>
where
    B1: SampleBorrow<Self::X> + Sized,
    B2: SampleBorrow<Self::X> + Sized,
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Self::X

impl<'de> Deserialize<'de> for UniformChar

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where
    __D: Deserializer<'de>,

Auto Trait Implementations

impl Freeze for UniformChar

impl RefUnwindSafe for UniformChar

impl Send for UniformChar

impl Sync for UniformChar

impl Unpin for UniformChar

impl UnsafeUnpin for UniformChar

impl UnwindSafe for UniformChar

Blanket Implementations

impl<T> Any for UniformChar where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for UniformChar where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for UniformChar where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for UniformChar where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> DeserializeOwned for UniformChar where T: for<'de> Deserialize<'de>,

impl<T> From<T> for UniformChar

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for UniformChar where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for UniformChar where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for UniformChar where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for UniformChar where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>