Skip to main content

Module field

Module field 

Source
Expand description

Support for matching and generating individual field/element values.

This is the field-level counterpart of crate::content: where a content matcher owns a whole content type, a field matcher applies one matching rule to one value inside somebody else’s content - a field in a JSON body, a header, a message metadata value. See proposal 006 (Field-level matchers and generators) for the design.

The proto types used here are the V2 interface ones. Field-level operations were introduced in V2 and have no V1 equivalent, so a V1 plugin cannot provide them.

Structs§

FieldContext
Where a value sits and what is known about it, shared by matching and generation.
FieldGenerator
Generator for a single field/element value. See FieldMatcher.
FieldMatcher
Matching rule for a single field/element value, provided by a plugin or by a handler the host framework registered (see crate::core_capabilities::CoreFieldMatcher).

Enums§

FieldValue
A single value being matched or generated at the field/element level - the driver-side counterpart of the proto FieldValue.
TestMode
Which side of the test a generator is running on, mirroring GenerateContentRequest.TestMode in the plugin interface.

Functions§

find_field_generator
Find the field-level generator with the given name. See find_field_matcher.
find_field_matcher
Find the field-level matching rule with the given name. The name is resolved against the catalogue the same way any other capability key is - see crate::catalogue_manager::resolve_capability - so creditcard finds a plugin’s own rule and type finds the core v2-type rule. Returns a descriptive error if the name matches nothing, matches more than one rule, or names something that is not a matching rule.