[−][src]Struct httptest::Server
The Server
Methods
impl Server
[src]
pub fn run() -> Self
[src]
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.
pub fn url(&self, path_and_query: &str) -> Uri
[src]
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"
pub fn url_str(&self, path_and_query: &str) -> String
[src]
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.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
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>,