pub struct TestServer { /* private fields */ }
Expand description
Test server controller
Implementations
sourceimpl TestServer
impl TestServer
sourcepub fn addr(&self) -> SocketAddr
pub fn addr(&self) -> SocketAddr
Construct test server url
sourcepub fn get<S: AsRef<str>>(&self, path: S) -> ClientRequest
pub fn get<S: AsRef<str>>(&self, path: S) -> ClientRequest
Create GET
request
sourcepub fn post<S: AsRef<str>>(&self, path: S) -> ClientRequest
pub fn post<S: AsRef<str>>(&self, path: S) -> ClientRequest
Create POST
request
sourcepub fn head<S: AsRef<str>>(&self, path: S) -> ClientRequest
pub fn head<S: AsRef<str>>(&self, path: S) -> ClientRequest
Create HEAD
request
sourcepub fn put<S: AsRef<str>>(&self, path: S) -> ClientRequest
pub fn put<S: AsRef<str>>(&self, path: S) -> ClientRequest
Create PUT
request
sourcepub fn patch<S: AsRef<str>>(&self, path: S) -> ClientRequest
pub fn patch<S: AsRef<str>>(&self, path: S) -> ClientRequest
Create PATCH
request
sourcepub fn delete<S: AsRef<str>>(&self, path: S) -> ClientRequest
pub fn delete<S: AsRef<str>>(&self, path: S) -> ClientRequest
Create DELETE
request
sourcepub fn options<S: AsRef<str>>(&self, path: S) -> ClientRequest
pub fn options<S: AsRef<str>>(&self, path: S) -> ClientRequest
Create OPTIONS
request
sourcepub fn request<S: AsRef<str>>(&self, method: Method, path: S) -> ClientRequest
pub fn request<S: AsRef<str>>(&self, method: Method, path: S) -> ClientRequest
Connect to test http server
sourcepub async fn load_body(
&self,
response: ClientResponse
) -> Result<Bytes, PayloadError>
pub async fn load_body(
&self,
response: ClientResponse
) -> Result<Bytes, PayloadError>
Load response’s body
sourcepub async fn ws_at(
&self,
path: &str
) -> Result<WsConnection<Sealed>, WsClientError>
pub async fn ws_at(
&self,
path: &str
) -> Result<WsConnection<Sealed>, WsClientError>
Connect to websocket server at a given path
sourcepub async fn ws(&self) -> Result<WsConnection<Sealed>, WsClientError>
pub async fn ws(&self) -> Result<WsConnection<Sealed>, WsClientError>
Connect to a websocket server
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for TestServer
impl !Send for TestServer
impl !Sync for TestServer
impl Unpin for TestServer
impl !UnwindSafe for TestServer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more