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.
pub async fn new_tls(
id: String,
pact: Box<dyn Pact>,
addr: SocketAddr,
tls: &ServerConfig,
config: MockServerConfig
) -> Result<(Arc<Mutex<MockServer>>, impl Future<Output = ()>), String>
pub async fn new_tls(
id: String,
pact: Box<dyn Pact>,
addr: SocketAddr,
tls: &ServerConfig,
config: MockServerConfig
) -> Result<(Arc<Mutex<MockServer>>, impl Future<Output = ()>), String>
Create a new TLS mock server, consisting of its state (self) and its executable server future.
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
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
Auto Trait Implementations
impl !RefUnwindSafe for MockServer
impl Send for MockServer
impl !Sync for MockServer
impl Unpin for MockServer
impl !UnwindSafe for MockServer
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
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