Struct actix_test::TestServer [−][src]
pub struct TestServer { /* fields omitted */ }
Expand description
A basic HTTP server controller that simplifies the process of writing integration tests for Actix Web applications.
See start
for usage example.
Implementations
Construct test server url
Create GET
request.
Create POST
request.
Create HEAD
request.
Create PUT
request.
Create PATCH
request.
Create DELETE
request.
Create OPTIONS
request.
Connect request with given method and path.
pub async fn load_body<S>(
&mut self,
response: ClientResponse<S>
) -> Result<Bytes, PayloadError> where
S: Stream<Item = Result<Bytes, PayloadError>> + Unpin + 'static,
pub async fn ws_at(
&mut self,
path: &str
) -> Result<Framed<impl AsyncRead + AsyncWrite, Codec>, WsClientError>
pub async fn ws_at(
&mut self,
path: &str
) -> Result<Framed<impl AsyncRead + AsyncWrite, Codec>, WsClientError>
Connect to WebSocket server at a given path.
pub async fn ws(
&mut self
) -> Result<Framed<impl AsyncRead + AsyncWrite, Codec>, WsClientError>
pub async fn ws(
&mut self
) -> Result<Framed<impl AsyncRead + AsyncWrite, Codec>, WsClientError>
Connect to a WebSocket server.
Get default HeaderMap of Client.
Returns Some(&mut HeaderMap) when Client object is unique (No other clone of client exists at the same time).
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
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more