pub struct TestServer { /* private fields */ }Expand description
Test server controller
Implementations§
Source§impl TestServer
impl TestServer
pub async fn create( id: Uuid, system: System, server: Server, addr: SocketAddr, timeout: Seconds, connect_timeout: Millis, ) -> Self
Sourcepub async fn set_client_timeout(
self,
timeout: Seconds,
connect_timeout: Millis,
) -> Self
pub async fn set_client_timeout( self, timeout: Seconds, connect_timeout: Millis, ) -> Self
Set client timeout
Sourcepub fn addr(&self) -> SocketAddr
pub fn addr(&self) -> SocketAddr
Construct test server url
Sourcepub fn request<S: AsRef<str>>(&self, method: Method, path: S) -> ClientRequest
pub fn request<S: AsRef<str>>(&self, method: Method, path: S) -> ClientRequest
Create client request
Sourcepub fn srequest<S: AsRef<str>>(&self, method: Method, path: S) -> ClientRequest
pub fn srequest<S: AsRef<str>>(&self, method: Method, path: S) -> ClientRequest
Create secure client request
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(&self) -> Result<WsConnection<impl Filter>, WsClientError>
pub async fn ws(&self) -> Result<WsConnection<impl Filter>, WsClientError>
Connect to a websocket server
Sourcepub async fn ws_at(
&self,
path: &str,
) -> Result<WsConnection<impl Filter>, WsClientError>
pub async fn ws_at( &self, path: &str, ) -> Result<WsConnection<impl Filter>, WsClientError>
Connect to websocket server at a given path
Sourcepub async fn wss(&self) -> Result<WsConnection<Layer<SslFilter>>, WsClientError>
pub async fn wss(&self) -> Result<WsConnection<Layer<SslFilter>>, WsClientError>
Connect to a websocket server
Sourcepub async fn wss_at(
&self,
path: &str,
) -> Result<WsConnection<Layer<SslFilter>>, WsClientError>
pub async fn wss_at( &self, path: &str, ) -> Result<WsConnection<Layer<SslFilter>>, WsClientError>
Connect to secure websocket server at a given path
Trait Implementations§
Source§impl Debug for TestServer
impl Debug for TestServer
Auto Trait Implementations§
impl !Freeze for TestServer
impl !RefUnwindSafe for TestServer
impl !Send for TestServer
impl !Sync for TestServer
impl !Unpin for TestServer
impl !UnsafeUnpin for TestServer
impl !UnwindSafe for TestServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more