Struct pact_mock_server::server_manager::ServerManager [−][src]
pub struct ServerManager { /* fields omitted */ }
Expand description
Struct to represent many mock servers running in a background thread
Implementations
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: Box<dyn Pact + Send + Sync>,
addr: SocketAddr,
config: MockServerConfig
) -> Result<SocketAddr, String>
pub fn start_mock_server_with_addr(
&mut self,
id: String,
pact: Box<dyn Pact + Send + Sync>,
addr: SocketAddr,
config: MockServerConfig
) -> Result<SocketAddr, String>
Start a new server on the runtime
pub fn start_tls_mock_server_with_addr(
&mut self,
id: String,
pact: Box<dyn Pact>,
addr: SocketAddr,
tls_config: &ServerConfig,
config: MockServerConfig
) -> Result<SocketAddr, String>
pub fn start_tls_mock_server_with_addr(
&mut self,
id: String,
pact: Box<dyn Pact>,
addr: SocketAddr,
tls_config: &ServerConfig,
config: MockServerConfig
) -> Result<SocketAddr, String>
Start a new TLS server on the runtime
Start a new server on the runtime
Start a new server on the runtime, returning the future
pub fn start_tls_mock_server(
&mut self,
id: String,
pact: Box<dyn Pact>,
port: u16,
tls: &ServerConfig,
config: MockServerConfig
) -> Result<u16, String>
pub fn start_tls_mock_server(
&mut self,
id: String,
pact: Box<dyn Pact>,
port: u16,
tls: &ServerConfig,
config: MockServerConfig
) -> Result<u16, String>
Start a new TLS server on the runtime
Shut down a server by its id
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>
pub fn find_mock_server_by_id<R>(
&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,
port: u16,
f: &dyn Fn(&mut MockServer) -> R
) -> Option<R>
pub fn find_mock_server_by_port_mut<R>(
&mut self,
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
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
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