Skip to main content

Nullable

Struct Nullable 

Source
pub struct Nullable<G> { /* private fields */ }
Expand description

Mixes NULL into another generator. Created by GeneratorExt::nullable.

Trait Implementations§

Source§

impl<G: Generator> Generator for Nullable<G>

Source§

fn generate( &self, rng: &mut dyn RngCore, index: usize, sql_type: &str, ) -> SeedValue

Returns the value for row index (0-based). sql_type is the column’s SQL type as declared, e.g. "INTEGER" or "TEXT".
Source§

fn name(&self) -> &'static str

Returns a short name for debugging. Defaults to the type name.

Auto Trait Implementations§

§

impl<G> Freeze for Nullable<G>
where G: Freeze,

§

impl<G> RefUnwindSafe for Nullable<G>
where G: RefUnwindSafe,

§

impl<G> Send for Nullable<G>
where G: Send,

§

impl<G> Sync for Nullable<G>
where G: Sync,

§

impl<G> Unpin for Nullable<G>
where G: Unpin,

§

impl<G> UnsafeUnpin for Nullable<G>
where G: UnsafeUnpin,

§

impl<G> UnwindSafe for Nullable<G>
where G: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<G> GeneratorExt for G
where G: Generator,

Source§

fn nullable(self, probability: f64) -> Nullable<Self>

Returns NULL with the given probability (0.0 to 1.0), otherwise a value from self. Read more
Source§

fn map<F, V>(self, f: F) -> Map<Self, F>
where F: Fn(SeedValue) -> V + Send + Sync, V: Into<SeedValue>,

Transforms each generated value with f.
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<Joined, From> JoinKey<From, JoinReverse> for Joined
where From: Joinable<Joined> + ?Sized,

Source§

fn pairs() -> &'static [(&'static str, &'static str)]

(joined_column, from_column) pairs the ON condition matches, in key order, read through Self::pair.
Source§

fn pair(pair: &(&'static str, &'static str)) -> (&'static str, &'static str)

The (joined_column, from_column) names of pair.
Source§

impl<List> ListIncludes<Nil, ()> for List

Source§

impl<Mk> MarkerAggValidFor<()> for Mk

Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> TypeEq<T> for T

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V