Struct pact_ffi::verifier::handle::VerifierHandle

source ·
pub struct VerifierHandle { /* private fields */ }
Expand description

Wraps a Pact verifier

Implementations§

source§

impl VerifierHandle

source

pub fn new() -> VerifierHandle

👎Deprecated since 0.1.4: Use new_for_application instead

Create a new verifier and return the handle to it (deprecated, use new_for_application)

source

pub fn new_for_application( calling_app_name: &str, calling_app_version: &str ) -> VerifierHandle

Create a new verifier and return the handle to it

source

pub fn provider_info(&self) -> ProviderInfo

Retrieve the provider info from the handle

source

pub fn add_transport( &mut self, protocol: String, port: u16, path: String, scheme: Option<String> )

Add a new transport to the verification process

source

pub fn update_provider_info( &mut self, name: String, scheme: String, host: String, port: u16, path: String )

Update the provider info

source

pub fn update_filter_info( &mut self, filter_description: String, filter_state: String, filter_no_state: bool )

Update the filter info

source

pub fn add_file_source(&mut self, file: &str)

Add a file source to be verified

source

pub fn add_directory_source(&mut self, dir: &str)

Add a directory source to be verified. This will verify all pact files in the directory.

source

pub fn add_url_source(&mut self, url: &str, auth: &HttpAuth)

Add a URL source to be verified. This will fetch the pact file from the URL. If a username and password is given, then basic authentication will be used when fetching the pact file. If a token is provided, then bearer token authentication will be used.

source

pub fn add_pact_broker_source( &mut self, url: &str, enable_pending: bool, include_wip_pacts_since: Option<String>, provider_tags: Vec<String>, provider_branch: Option<String>, selectors: Vec<ConsumerVersionSelector>, auth: &HttpAuth )

Add a Pact broker source to be verified. This will fetch all the pact files from the broker that match the provider name. If a username and password is given, the basic authentication will be used when fetching the pact file. If a token is provided, then bearer token authentication will be used.

source

pub fn update_provider_state( &mut self, state_change_url: Option<String>, state_change_teardown: bool, state_change_body: bool )

Update the provider state

source

pub fn update_verification_options( &mut self, disable_ssl_verification: bool, request_timeout: u64 )

Update options used when running a verification

§Args
  • disable_ssl_verification - Disable SSL verification on all HTTPS requests
  • request_timeout - Timeout for all requests to the provider
source

pub fn set_use_coloured_output(&mut self, coloured_output: bool)

Enables or disables use of ANSI escape codes with the verifier output

source

pub fn set_no_pacts_is_error(&mut self, is_error: bool)

Enables or disables erroring if no pacts are found to verify

source

pub fn update_publish_options( &mut self, provider_version: &str, build_url: Option<String>, provider_tags: Vec<String>, provider_branch: Option<String> )

Update the details used when publishing results

§Args
  • provider_version - Version of the provider
source

pub fn update_consumers(&mut self, consumers: Vec<String>)

Update the consumer filter

source

pub fn execute(&mut self) -> i32

Execute the verifier

This will return an integer value based on the status of the verification:

  • 0 - verification was successful
  • 1 - verification was not successful
  • 2 - failed to run the verification

Anu captured output from the verification will be stored against this handle

source

pub fn output(&self) -> String

Return the captured standard output from the verification execution

source

pub fn json(&self) -> String

Return the verification results as a JSON document

source

pub fn add_custom_header(&mut self, header_name: &str, header_value: &str)

Add a custom header to be included in the call to the provider

Trait Implementations§

source§

impl Clone for VerifierHandle

source§

fn clone(&self) -> VerifierHandle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VerifierHandle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for VerifierHandle

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more