Enum pact_models::generators::Generator [−][src]
pub enum Generator {
Show 13 variants
RandomInt(i32, i32),
Uuid(Option<UuidFormat>),
RandomDecimal(u16),
RandomHexadecimal(u16),
RandomString(u16),
Regex(String),
Date(Option<String>),
Time(Option<String>),
DateTime(Option<String>),
RandomBoolean,
ProviderStateGenerator(String, Option<DataType>),
MockServerURL(String, String),
ArrayContains(Vec<(usize, MatchingRuleCategory, HashMap<DocPath, Generator>)>),
}
Expand description
Trait to represent a generator
Variants
RandomInt(i32, i32)
Generates a random integer between the min and max values
Uuid(Option<UuidFormat>)
Tuple Fields
0: Option<UuidFormat>
Generates a random UUID value
RandomDecimal(u16)
Tuple Fields
0: u16
Generates a random sequence of digits
RandomHexadecimal(u16)
Tuple Fields
0: u16
Generates a random sequence of hexadecimal digits
RandomString(u16)
Tuple Fields
0: u16
Generates a random string of the provided size
Regex(String)
Tuple Fields
0: 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, Option<DataType>)
Generates a value that is looked up from the provider state context
MockServerURL(String, String)
Generates a URL with the mock server as the base URL
ArrayContains(Vec<(usize, MatchingRuleCategory, HashMap<DocPath, Generator>)>)
List of variants which can have embedded generators
Implementations
Converts a JSON map into a Generator
struct, returning None
if it can not be converted.
If this generator is compatible with the given generator mode
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Generator
impl UnwindSafe for Generator
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more