Skip to main content

Module core_capabilities

Module core_capabilities 

Source
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§

CoreContentGenerator
A host-provided handler for the GenerateContent capability shape. Implemented by the embedding Pact framework and registered via register_core_content_generator.
CoreContentMatcher
A host-provided handler for the CompareContents capability shape. Implemented by the embedding Pact framework and registered via register_core_content_matcher.
CoreFieldGenerator
A host-provided handler for the GenerateField capability shape - one of the standard Pact generators applied to a single value. Implemented by the embedding Pact framework and registered via register_core_field_generator. See CoreFieldMatcher.
CoreFieldMatcher
A host-provided handler for the MatchField capability shape - one of the standard Pact matching rules applied to a single value. Implemented by the embedding Pact framework and registered via register_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 the core/content-generator/xml entry). 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 the core/content-matcher/xml entry). 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. "date" for the core/generator/date entry). 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. "type" for the core/matcher/type entry). Replaces any handler previously registered under the same key.