Skip to main content

PactPlugin

Trait PactPlugin 

Source
pub trait PactPlugin:
    Send
    + Sync
    + 'static {
    // Required methods
    fn init_plugin<'life0, 'async_trait>(
        &'life0 self,
        request: Request<InitPluginRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<InitPluginResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_catalogue<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Catalogue>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn compare_contents<'life0, 'async_trait>(
        &'life0 self,
        request: Request<CompareContentsRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<CompareContentsResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn configure_interaction<'life0, 'async_trait>(
        &'life0 self,
        request: Request<ConfigureInteractionRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<ConfigureInteractionResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn generate_content<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GenerateContentRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<GenerateContentResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn match_field<'life0, 'async_trait>(
        &'life0 self,
        request: Request<MatchFieldRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<MatchFieldResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn generate_field<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GenerateFieldRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<GenerateFieldResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn start_mock_server<'life0, 'async_trait>(
        &'life0 self,
        request: Request<StartMockServerRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<StartMockServerResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown_mock_server<'life0, 'async_trait>(
        &'life0 self,
        request: Request<MockServerRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<MockServerResults>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_mock_server_results<'life0, 'async_trait>(
        &'life0 self,
        request: Request<MockServerRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<MockServerResults>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn prepare_interaction_for_verification<'life0, 'async_trait>(
        &'life0 self,
        request: Request<VerificationPreparationRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<VerificationPreparationResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn verify_interaction<'life0, 'async_trait>(
        &'life0 self,
        request: Request<VerifyInteractionRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<VerifyInteractionResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with PactPluginServer.

Required Methods§

Source

fn init_plugin<'life0, 'async_trait>( &'life0 self, request: Request<InitPluginRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<InitPluginResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check that the plugin loaded OK. Returns the catalogue entries describing what the plugin provides

Source

fn update_catalogue<'life0, 'async_trait>( &'life0 self, request: Request<Catalogue>, ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Updated catalogue. This will be sent when the core catalogue has been updated (probably by a plugin loading).

Source

fn compare_contents<'life0, 'async_trait>( &'life0 self, request: Request<CompareContentsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CompareContentsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Request to perform a comparison of some contents (matching request)

Source

fn configure_interaction<'life0, 'async_trait>( &'life0 self, request: Request<ConfigureInteractionRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<ConfigureInteractionResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Request to configure/setup the interaction for later verification. Data returned will be persisted in the pact file.

Source

fn generate_content<'life0, 'async_trait>( &'life0 self, request: Request<GenerateContentRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GenerateContentResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Request to generate the content using any defined generators

Source

fn match_field<'life0, 'async_trait>( &'life0 self, request: Request<MatchFieldRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<MatchFieldResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Apply a plugin-provided matching rule to a single value. Required for any plugin that registers a MATCHER catalogue entry. See proposal 006 (Field-level matchers and generators).

Source

fn generate_field<'life0, 'async_trait>( &'life0 self, request: Request<GenerateFieldRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GenerateFieldResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Apply a plugin-provided generator to a single value. Required for any plugin that registers a GENERATOR catalogue entry. See proposal 006.

Source

fn start_mock_server<'life0, 'async_trait>( &'life0 self, request: Request<StartMockServerRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<StartMockServerResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start a mock server

Source

fn shutdown_mock_server<'life0, 'async_trait>( &'life0 self, request: Request<MockServerRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<MockServerResults>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shutdown a running mock server

Source

fn get_mock_server_results<'life0, 'async_trait>( &'life0 self, request: Request<MockServerRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<MockServerResults>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the matching results from a running mock server

Source

fn prepare_interaction_for_verification<'life0, 'async_trait>( &'life0 self, request: Request<VerificationPreparationRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<VerificationPreparationResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prepare an interaction for verification. This should return any data required to construct any request so that it can be amended before the verification is run

Source

fn verify_interaction<'life0, 'async_trait>( &'life0 self, request: Request<VerifyInteractionRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<VerifyInteractionResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute the verification for the interaction.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§