Expand description
Registry of host-provided (“core”) capability handlers, keyed by catalogue entry key.
This generalises the crate::plugin_log_sink::PluginLogSink pattern from a single sink to
one handler per capability shape: the driver defines a narrow trait per capability (matching
an operation already defined for plugins), the embedding Pact framework implements it and
registers an instance here at startup, and the driver never has a compile-time dependency on
that implementation. See proposal 007 (Driver-plugin callback model) for the full design.
Registration should happen alongside crate::catalogue_manager::register_core_entries for
the corresponding CatalogueEntryProviderType::CORE entry, so an entry and its handler never
drift apart. Callers resolve a capability via the catalogue entry’s key (unprefixed, e.g.
"xml" for core/content-matcher/xml), not the full catalogue key.
Traits§
- Core
Content Generator - A host-provided handler for the
GenerateContentcapability shape. Implemented by the embedding Pact framework and registered viaregister_core_content_generator. - Core
Content Matcher - A host-provided handler for the
CompareContentscapability shape. Implemented by the embedding Pact framework and registered viaregister_core_content_matcher. - Core
Field Generator - A host-provided handler for the
GenerateFieldcapability shape - one of the standard Pact generators applied to a single value. Implemented by the embedding Pact framework and registered viaregister_core_field_generator. SeeCoreFieldMatcher. - Core
Field Matcher - A host-provided handler for the
MatchFieldcapability shape - one of the standard Pact matching rules applied to a single value. Implemented by the embedding Pact framework and registered viaregister_core_field_matcher. See proposals 006 (Field-level matchers and generators) and 009 (Host-provided core matching and generation).
Functions§
- deregister_
core_ content_ generator - Remove a registered core content generator handler. Mainly useful for tests.
- deregister_
core_ content_ matcher - Remove a registered core content matcher handler. Mainly useful for tests.
- deregister_
core_ field_ generator - Remove a registered core field generator handler. Mainly useful for tests.
- deregister_
core_ field_ matcher - Remove a registered core field matcher handler. Mainly useful for tests.
- lookup_
core_ content_ generator - Look up a registered core content generator handler by catalogue entry key.
- lookup_
core_ content_ matcher - Look up a registered core content matcher handler by catalogue entry key.
- lookup_
core_ field_ generator - Look up a registered core field generator handler by catalogue entry key.
- lookup_
core_ field_ matcher - Look up a registered core field matcher handler by catalogue entry key.
- register_
core_ content_ generator - Register a handler for a host-provided content generator capability, keyed by the catalogue
entry key (e.g.
"xml"for thecore/content-generator/xmlentry). Replaces any handler previously registered under the same key. - register_
core_ content_ matcher - Register a handler for a host-provided content matcher capability, keyed by the catalogue
entry key (e.g.
"xml"for thecore/content-matcher/xmlentry). Replaces any handler previously registered under the same key. - register_
core_ field_ generator - Register a handler for a host-provided field generator, keyed by the catalogue entry key
(e.g.
"v3-date"for thecore/generator/v3-dateentry). Replaces any handler previously registered under the same key. - register_
core_ field_ matcher - Register a handler for a host-provided field matching rule, keyed by the catalogue entry key
(e.g.
"v2-type"for thecore/matcher/v2-typeentry). Replaces any handler previously registered under the same key.