Start a server.
The server will run in the background. On Drop it will terminate and assert it's expectations.
pub fn addr(&self) -> SocketAddr[src]
Get the address the server is listening on.
Get a fully formed url to the servers address.
If the server is listening on port 1234.
server.url("/foo?q=1") == "http://localhost:1234/foo?q=1"
Get a fully formed url to the servers address as a String.
server.url_str(foo) == server.url(foo).to_string()
pub fn expect(&self, expectation: Expectation)[src]
Add a new expectation to the server.
pub fn verify_and_clear(&mut self)[src]
Verify all registered expectations. Panic if any are not met, then clear all expectations leaving the server running in a clean state.
impl !RefUnwindSafe for Server
impl !UnwindSafe for Server
type Error = Infallible
The type returned in the event of a conversion error.