[][src]Enum pact_matching::models::generators::Generator

pub enum Generator {
    RandomInt(i32i32),
    Uuid,
    RandomDecimal(u16),
    RandomHexadecimal(u16),
    RandomString(u16),
    Regex(String),
    Date(Option<String>),
    Time(Option<String>),
    DateTime(Option<String>),
    RandomBoolean,
    ProviderStateGenerator(String),
}

Trait to represent a generator

Variants

RandomInt(i32i32)

Generates a random integer between the min and max values

Uuid

Generates a random UUID value

RandomDecimal(u16)

Generates a random sequence of digits

RandomHexadecimal(u16)

Generates a random sequence of hexadecimal digits

RandomString(u16)

Generates a random string of the provided size

Regex(String)

Generates a random string that matches the provided regex

Date(Option<String>)

Generates a random date that matches either the provided format or the ISO format

Time(Option<String>)

Generates a random time that matches either the provided format or the ISO format

DateTime(Option<String>)

Generates a random timestamp that matches either the provided format or the ISO format

RandomBoolean

Generates a random boolean value

ProviderStateGenerator(String)

Generates a value that is looked up from the provider state context

Methods

impl Generator[src]

pub fn to_json(&self) -> Value[src]

Convert this generator to a JSON struct

pub fn from_map(
    gen_type: &String,
    map: &Map<String, Value>
) -> Option<Generator>
[src]

Converts a JSON map into a Generator struct, returning None if it can not be converted.

Trait Implementations

impl Clone for Generator[src]

impl Debug for Generator[src]

impl<'de> Deserialize<'de> for Generator[src]

impl Eq for Generator[src]

impl GenerateValue<String> for Generator[src]

impl GenerateValue<Value> for Generator[src]

impl GenerateValue<Vec<String>> for Generator[src]

impl GenerateValue<u16> for Generator[src]

impl Hash for Generator[src]

impl PartialEq<Generator> for Generator[src]

impl Serialize for Generator[src]

impl StructuralEq for Generator[src]

impl StructuralPartialEq for Generator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

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