[][src]Struct pact_mock_server::mock_server::MockServer

pub struct MockServer {
    pub id: String,
    pub scheme: MockServerScheme,
    pub port: Option<u16>,
    pub address: Option<String>,
    pub resources: Vec<CString>,
    pub pact: RequestResponsePact,
    pub config: MockServerConfig,
    // some fields omitted
}

Struct to represent the "foreground" part of mock server

Fields

id: String

Mock server unique ID

scheme: MockServerScheme

Scheme the mock server is using

port: Option<u16>

Port the mock server is running on

address: Option<String>

Address the mock server is bound to

resources: Vec<CString>

List of resources that need to be cleaned up when the mock server completes

pact: RequestResponsePact

Pact that this mock server is based on

config: MockServerConfig

Mock server config

Implementations

impl MockServer[src]

pub async fn new(
    id: String,
    pact: RequestResponsePact,
    addr: SocketAddr,
    config: MockServerConfig
) -> Result<(Arc<Mutex<MockServer>>, impl Future<Output = ()>), String>
[src]

Create a new mock server, consisting of its state (self) and its executable server future.

pub async fn new_tls(
    id: String,
    pact: RequestResponsePact,
    addr: SocketAddr,
    tls: &ServerConfig,
    config: MockServerConfig
) -> Result<(Arc<Mutex<MockServer>>, impl Future<Output = ()>), String>
[src]

Create a new TLS mock server, consisting of its state (self) and its executable server future.

pub fn shutdown(&mut self) -> Result<(), String>[src]

Send the shutdown signal to the server

pub fn to_json(&self) -> Value[src]

Converts this mock server to a Value struct

pub fn matches(&self) -> Vec<MatchResult>[src]

Returns all collected matches

pub fn mismatches(&self) -> Vec<MatchResult>[src]

Returns all the mismatches that have occurred with this mock server

pub fn write_pact(&self, output_path: &Option<String>) -> Result<()>[src]

Mock server writes its pact out to the provided directory

pub fn url(&self) -> String[src]

Returns the URL of the mock server

Trait Implementations

impl Clone for MockServer[src]

pub fn clone(&self) -> MockServer[src]

Make a clone all of the MockServer fields. Note that the clone of the original server cannot be shut down directly.

impl Debug for MockServer[src]

impl Default for MockServer[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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