[−][src]Enum pact_matching::models::generators::Generator
Trait to represent a generator
Variants
Generates a random integer between the min and max values
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
Generates a random date that matches either the provided format or the ISO format
Generates a random time that matches either the provided format or the ISO format
Generates a random timestamp that matches either the provided format or the ISO format
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]
gen_type: &String,
map: &Map<String, Value>
) -> Option<Generator>
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Generator
[src]
impl GenerateValue<String> for Generator
[src]
impl GenerateValue<Value> for Generator
[src]
impl GenerateValue<Vec<String>> for Generator
[src]
fn generate_value(
&self,
vals: &Vec<String>,
context: &HashMap<String, Value>
) -> Option<Vec<String>>
[src]
&self,
vals: &Vec<String>,
context: &HashMap<String, Value>
) -> Option<Vec<String>>
impl GenerateValue<u16> for Generator
[src]
impl Hash for Generator
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Generator> for Generator
[src]
impl Serialize for Generator
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Generator
[src]
impl StructuralPartialEq for Generator
[src]
Auto Trait Implementations
impl RefUnwindSafe for Generator
impl Send for Generator
impl Sync for Generator
impl Unpin for Generator
impl UnwindSafe for Generator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,