[−][src]Struct httptest::ServerHandle
A handle to a server. Expectations are inserted when the handle is dropped.
Methods from Deref<Target = Server>
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
impl<'a> Debug for ServerHandle<'a>
[src]
impl Deref for ServerHandle<'_>
[src]
impl DerefMut for ServerHandle<'_>
[src]
impl Drop for ServerHandle<'_>
[src]
Auto Trait Implementations
impl<'a> !RefUnwindSafe for ServerHandle<'a>
[src]
impl<'a> Send for ServerHandle<'a>
[src]
impl<'a> Sync for ServerHandle<'a>
[src]
impl<'a> Unpin for ServerHandle<'a>
[src]
impl<'a> !UnwindSafe for ServerHandle<'a>
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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.
pub 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>,