[−][src]Struct pact_mock_server::mock_server::MockServer
Struct to represent the "foreground" part of mock server
Fields
id: String
Mock server unique ID
addr: SocketAddr
Address the mock server is running on
resources: Vec<CString>
List of resources that need to be cleaned up when the mock server completes
pact: Pact
Pact that this mock server is based on
Methods
impl MockServer
[src]
pub fn new(
id: String,
pact: Pact,
port: u16
) -> Result<(MockServer, impl Future<Item = (), Error = ()>), String>
[src]
id: String,
pact: Pact,
port: u16
) -> Result<(MockServer, impl Future<Item = (), Error = ()>), String>
Create a new 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]
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.
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MockServer
[src]
Auto Trait Implementations
impl Unpin for MockServer
impl Sync for MockServer
impl Send for MockServer
impl !UnwindSafe for MockServer
impl !RefUnwindSafe for MockServer
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,