pub struct PactPluginClient<T> { /* private fields */ }
Implementations§
source§impl<T> PactPluginClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> PactPluginClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F
) -> PactPluginClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn init_plugin(
&mut self,
request: impl IntoRequest<InitPluginRequest>
) -> Result<Response<InitPluginResponse>, Status>
pub async fn init_plugin( &mut self, request: impl IntoRequest<InitPluginRequest> ) -> Result<Response<InitPluginResponse>, Status>
Check that the plugin loaded OK. Returns the catalogue entries describing what the plugin provides
sourcepub async fn update_catalogue(
&mut self,
request: impl IntoRequest<Catalogue>
) -> Result<Response<()>, Status>
pub async fn update_catalogue( &mut self, request: impl IntoRequest<Catalogue> ) -> Result<Response<()>, Status>
Updated catalogue. This will be sent when the core catalogue has been updated (probably by a plugin loading).
sourcepub async fn compare_contents(
&mut self,
request: impl IntoRequest<CompareContentsRequest>
) -> Result<Response<CompareContentsResponse>, Status>
pub async fn compare_contents( &mut self, request: impl IntoRequest<CompareContentsRequest> ) -> Result<Response<CompareContentsResponse>, Status>
Request to perform a comparison of some contents (matching request)
sourcepub async fn configure_interaction(
&mut self,
request: impl IntoRequest<ConfigureInteractionRequest>
) -> Result<Response<ConfigureInteractionResponse>, Status>
pub async fn configure_interaction( &mut self, request: impl IntoRequest<ConfigureInteractionRequest> ) -> Result<Response<ConfigureInteractionResponse>, Status>
Request to configure/setup the interaction for later verification. Data returned will be persisted in the pact file.
sourcepub async fn generate_content(
&mut self,
request: impl IntoRequest<GenerateContentRequest>
) -> Result<Response<GenerateContentResponse>, Status>
pub async fn generate_content( &mut self, request: impl IntoRequest<GenerateContentRequest> ) -> Result<Response<GenerateContentResponse>, Status>
Request to generate the content using any defined generators
sourcepub async fn start_mock_server(
&mut self,
request: impl IntoRequest<StartMockServerRequest>
) -> Result<Response<StartMockServerResponse>, Status>
pub async fn start_mock_server( &mut self, request: impl IntoRequest<StartMockServerRequest> ) -> Result<Response<StartMockServerResponse>, Status>
Start a mock server
sourcepub async fn shutdown_mock_server(
&mut self,
request: impl IntoRequest<ShutdownMockServerRequest>
) -> Result<Response<ShutdownMockServerResponse>, Status>
pub async fn shutdown_mock_server( &mut self, request: impl IntoRequest<ShutdownMockServerRequest> ) -> Result<Response<ShutdownMockServerResponse>, Status>
Shutdown a running mock server TODO: Replace the message types with MockServerRequest and MockServerResults in the next major version
sourcepub async fn get_mock_server_results(
&mut self,
request: impl IntoRequest<MockServerRequest>
) -> Result<Response<MockServerResults>, Status>
pub async fn get_mock_server_results( &mut self, request: impl IntoRequest<MockServerRequest> ) -> Result<Response<MockServerResults>, Status>
Get the matching results from a running mock server
sourcepub async fn prepare_interaction_for_verification(
&mut self,
request: impl IntoRequest<VerificationPreparationRequest>
) -> Result<Response<VerificationPreparationResponse>, Status>
pub async fn prepare_interaction_for_verification( &mut self, request: impl IntoRequest<VerificationPreparationRequest> ) -> Result<Response<VerificationPreparationResponse>, Status>
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
sourcepub async fn verify_interaction(
&mut self,
request: impl IntoRequest<VerifyInteractionRequest>
) -> Result<Response<VerifyInteractionResponse>, Status>
pub async fn verify_interaction( &mut self, request: impl IntoRequest<VerifyInteractionRequest> ) -> Result<Response<VerifyInteractionResponse>, Status>
Execute the verification for the interaction.
Trait Implementations§
source§impl<T: Clone> Clone for PactPluginClient<T>
impl<T: Clone> Clone for PactPluginClient<T>
source§fn clone(&self) -> PactPluginClient<T>
fn clone(&self) -> PactPluginClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for PactPluginClient<T>
impl<T> RefUnwindSafe for PactPluginClient<T>where
T: RefUnwindSafe,
impl<T> Send for PactPluginClient<T>where
T: Send,
impl<T> Sync for PactPluginClient<T>where
T: Sync,
impl<T> Unpin for PactPluginClient<T>where
T: Unpin,
impl<T> UnwindSafe for PactPluginClient<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request