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

pub struct MockServer {
    pub id: String,
    pub scheme: MockServerScheme,
    pub port: Option<u16>,
    pub address: Option<String>,
    pub resources: Vec<CString>,
    pub pact: Arc<Mutex<dyn Pact + Send + Sync>>,
    pub config: MockServerConfig,
    pub metrics: MockServerMetrics,
    // some fields omitted
}
Expand description

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: Arc<Mutex<dyn Pact + Send + Sync>>

Pact that this mock server is based on

config: MockServerConfig

Mock server config

metrics: MockServerMetrics

Metrics collected by the mock server

Implementations

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

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

Send the shutdown signal to the server

Converts this mock server to a Value struct

Returns all collected matches

Returns all the mismatches that have occurred with this mock server

Mock server writes its pact out to the provided directory

Returns the URL of the mock server

Trait Implementations

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

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

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

Performs the conversion.

Wrap the input message T in a tonic::Request

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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