[−][src]Struct pact_mock_server::mock_server::MockServer
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]
id: String,
pact: RequestResponsePact,
addr: SocketAddr,
config: MockServerConfig
) -> Result<(Arc<Mutex<MockServer>>, impl Future<Output = ()>), String>
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]
id: String,
pact: RequestResponsePact,
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.
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.
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MockServer
[src]
impl Default for MockServer
[src]
pub fn default() -> MockServer
[src]
Auto Trait Implementations
impl !RefUnwindSafe for MockServer
[src]
impl Send for MockServer
[src]
impl !Sync for MockServer
[src]
impl Unpin for MockServer
[src]
impl !UnwindSafe for MockServer
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,