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.

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.
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.
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.