[][src]Struct pact_mock_server::server_manager::ServerManager

pub struct ServerManager { /* fields omitted */ }

Struct to represent many mock servers running in a background thread

Implementations

impl ServerManager[src]

pub fn new() -> ServerManager[src]

Construct a new ServerManager for scheduling several instances of mock servers on one tokio runtime.

pub fn start_mock_server_with_addr(
    &mut self,
    id: String,
    pact: Pact,
    addr: SocketAddr
) -> Result<SocketAddr, String>
[src]

Start a new server on the runtime

pub fn start_tls_mock_server_with_addr(
    &mut self,
    id: String,
    pact: Pact,
    addr: SocketAddr,
    tls: &ServerConfig
) -> Result<SocketAddr, String>
[src]

Start a new TLS server on the runtime

pub fn start_mock_server(
    &mut self,
    id: String,
    pact: Pact,
    port: u16
) -> Result<u16, String>
[src]

Start a new server on the runtime

pub fn start_tls_mock_server(
    &mut self,
    id: String,
    pact: Pact,
    port: u16,
    tls: &ServerConfig
) -> Result<u16, String>
[src]

Start a new TLS server on the runtime

pub fn shutdown_mock_server_by_id(&mut self, id: String) -> bool[src]

Shut down a server by its id

pub fn shutdown_mock_server_by_port(&mut self, port: u16) -> bool[src]

Shut down a server by its local port number

pub fn find_mock_server_by_id<R>(
    &self,
    id: &String,
    f: &dyn Fn(&MockServer) -> R
) -> Option<R>
[src]

Find mock server by id, and map it using supplied function if found

pub fn find_mock_server_by_port_mut<R>(
    &mut self,
    mock_server_port: u16,
    f: &dyn Fn(&mut MockServer) -> R
) -> Option<R>
[src]

Find a mock server by port number and apply a mutating operation on it if successful

pub fn map_mock_servers<R>(&self, f: &dyn Fn(&MockServer) -> R) -> Vec<R>[src]

Map all the running mock servers

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, U> Into<U> for T where
    U: From<T>, 
[src]

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<T> Typeable for T where
    T: Any

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