One

Trait One 

Source
pub trait One
where Self: Sized,
{ // Required method fn one() -> Gen<Self>; }
Expand description

Trait for types that can generate a single random value.

Required Methods§

Source

fn one() -> Gen<Self>

Generate a single random value of this type.

§Returns
  • Gen<Self> - A generator that produces a random value of this type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl One for bool

Source§

fn one() -> Gen<Self>

Generate a single random bool value.

§Returns
  • Gen<Self> - A generator that produces a random bool value.
Source§

impl One for char

Source§

fn one() -> Gen<Self>

Generate a single random char value.

§Returns
  • Gen<Self> - A generator that produces a random char value.
Source§

impl One for f32

Source§

fn one() -> Gen<Self>

Generate a single random f32 value.

§Returns
  • Gen<Self> - A generator that produces a random f32 value.
Source§

impl One for f64

Source§

fn one() -> Gen<Self>

Generate a single random f64 value.

§Returns
  • Gen<Self> - A generator that produces a random f64 value.
Source§

impl One for i8

Source§

fn one() -> Gen<Self>

Generate a single random i8 value.

§Returns
  • Gen<Self> - A generator that produces a random i8 value.
Source§

impl One for i16

Source§

fn one() -> Gen<Self>

Generate a single random i16 value.

§Returns
  • Gen<Self> - A generator that produces a random i16 value.
Source§

impl One for i32

Source§

fn one() -> Gen<Self>

Generate a single random i32 value.

§Returns
  • Gen<Self> - A generator that produces a random i32 value.
Source§

impl One for i64

Source§

fn one() -> Gen<Self>

Generate a single random i64 value.

§Returns
  • Gen<Self> - A generator that produces a random i64 value.
Source§

impl One for u8

Source§

fn one() -> Gen<Self>

Generate a single random u8 value.

§Returns
  • Gen<Self> - A generator that produces a random u8 value.
Source§

impl One for u16

Source§

fn one() -> Gen<Self>

Generate a single random u16 value.

§Returns
  • Gen<Self> - A generator that produces a random u16 value.
Source§

impl One for u32

Source§

fn one() -> Gen<Self>

Generate a single random u32 value.

§Returns
  • Gen<Self> - A generator that produces a random u32 value.
Source§

impl One for u64

Source§

fn one() -> Gen<Self>

Generate a single random u64 value.

§Returns
  • Gen<Self> - A generator that produces a random u64 value.

Implementors§