#[must_use = "WsBuilder does nothing on its own"]
pub struct WsBuilder { /* fields omitted */ }
Sets the request path of this builder.
The default is not set is /
.
let req = warp::test::ws()
.path("/chat");
This panics if the passed string is not able to be parsed as a valid
Uri
.
Set a header for this request.
let req = warp::test::ws()
.header("foo", "bar");
This panics if the passed strings are not able to be parsed as a valid
HeaderName
and HeaderValue
.
Execute this Websocket request against te provided filter.
If the handshake succeeds, returns a WsClient
.
use futures::future;
use warp::Filter;
let route = warp::ws2()
.map(|ws: warp::ws::Ws2| {
ws.on_upgrade(|_| future::ok(()))
});
let client = warp::test::ws()
.handshake(route)
.expect("handshake");
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static