[−][src]Struct pact_mock_server::server_manager::ServerManager
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]
&mut self,
id: String,
pact: Pact,
addr: SocketAddr
) -> Result<SocketAddr, String>
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]
&mut self,
id: String,
pact: Pact,
addr: SocketAddr,
tls: &ServerConfig
) -> Result<SocketAddr, String>
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]
&mut self,
id: String,
pact: Pact,
port: u16
) -> Result<u16, String>
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]
&mut self,
id: String,
pact: Pact,
port: u16,
tls: &ServerConfig
) -> Result<u16, String>
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]
&self,
id: &String,
f: &dyn Fn(&MockServer) -> R
) -> Option<R>
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]
&mut self,
mock_server_port: u16,
f: &dyn Fn(&mut MockServer) -> R
) -> Option<R>
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
impl !RefUnwindSafe for ServerManager
impl Send for ServerManager
impl Sync for ServerManager
impl Unpin for ServerManager
impl !UnwindSafe for ServerManager
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,