[][src]Trait pact_matching::models::generators::ContentTypeHandler

pub trait ContentTypeHandler<T> {
    fn process_body(
        &mut self,
        generators: &HashMap<String, Generator>,
        context: &HashMap<String, Value>
    ) -> OptionalBody;
fn apply_key(
        &mut self,
        key: &String,
        generator: &Generator,
        context: &HashMap<String, Value>
    ); }

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

Required methods

fn process_body(
    &mut self,
    generators: &HashMap<String, Generator>,
    context: &HashMap<String, Value>
) -> OptionalBody

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

fn apply_key(
    &mut self,
    key: &String,
    generator: &Generator,
    context: &HashMap<String, Value>
)

Applies the generator to the key in the body.

Loading content...

Implementors

impl ContentTypeHandler<Value> for JsonHandler[src]

impl<'a> ContentTypeHandler<Document<'a>> for XmlHandler<'a>[src]

Loading content...