pub trait ContentTypeHandler<T> {
    // Required methods
    fn process_body(
        &mut self,
        generators: &HashMap<DocPath, Generator>,
        mode: &GeneratorTestMode,
        context: &HashMap<&str, Value>,
        matcher: &Box<dyn VariantMatcher + Send + Sync>
    ) -> Result<OptionalBody, String>;
    fn apply_key(
        &mut self,
        key: &DocPath,
        generator: &dyn GenerateValue<T>,
        context: &HashMap<&str, Value>,
        matcher: &Box<dyn VariantMatcher + Send + Sync>
    );
}
Expand description

Trait to define a handler for applying generators to data of a particular content type.

Required Methods§

source

fn process_body( &mut self, generators: &HashMap<DocPath, Generator>, mode: &GeneratorTestMode, context: &HashMap<&str, Value>, matcher: &Box<dyn VariantMatcher + Send + Sync> ) -> Result<OptionalBody, String>

Processes the body using the map of generators, returning a (possibly) updated body.

source

fn apply_key( &mut self, key: &DocPath, generator: &dyn GenerateValue<T>, context: &HashMap<&str, Value>, matcher: &Box<dyn VariantMatcher + Send + Sync> )

Applies the generator to the key in the body.

Implementors§