pub struct TestWebSocketRequest<'a, A>where
A: Application,{ /* private fields */ }Available on non-WebAssembly only.
Expand description
A WebSocket upgrade request being built; see
TestClient::websocket.
Implementations§
Source§impl<'a, A> TestWebSocketRequest<'a, A>where
A: Application,
impl<'a, A> TestWebSocketRequest<'a, A>where
A: Application,
Sourcepub fn header(self, name: &str, value: &str) -> TestWebSocketRequest<'a, A>
pub fn header(self, name: &str, value: &str) -> TestWebSocketRequest<'a, A>
Add a request header (an Authorization or Cookie for a guarded
route, a Sec-WebSocket-Protocol, …).
Sourcepub fn timeout(self, timeout: Duration) -> TestWebSocketRequest<'a, A>
pub fn timeout(self, timeout: Duration) -> TestWebSocketRequest<'a, A>
How long TestWebSocket::recv and close
wait for the handler (default DEFAULT_TIMEOUT).
Sourcepub fn connect(self) -> Result<TestWebSocket, TestResponse>
pub fn connect(self) -> Result<TestWebSocket, TestResponse>
Send the handshake. A 101 from WebSocket::upgrade starts the
handler and returns the connection; any other answer — 426 for a
route that isn’t a WebSocket, 401 from an auth layer, a 101 built
by hand without a handler — comes back as the Err response.
Auto Trait Implementations§
impl<'a, A> Freeze for TestWebSocketRequest<'a, A>where
TestRequest<'a, A>: Freeze,
impl<'a, A> RefUnwindSafe for TestWebSocketRequest<'a, A>where
TestRequest<'a, A>: RefUnwindSafe,
impl<'a, A> Send for TestWebSocketRequest<'a, A>where
TestRequest<'a, A>: Send,
impl<'a, A> Sync for TestWebSocketRequest<'a, A>where
TestRequest<'a, A>: Sync,
impl<'a, A> Unpin for TestWebSocketRequest<'a, A>where
TestRequest<'a, A>: Unpin,
impl<'a, A> UnsafeUnpin for TestWebSocketRequest<'a, A>where
TestRequest<'a, A>: UnsafeUnpin,
impl<'a, A> UnwindSafe for TestWebSocketRequest<'a, A>where
TestRequest<'a, A>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more