Struct choices::warp::test::WsBuilder [−][src]
#[must_use = "WsBuilder does nothing on its own"]pub struct WsBuilder { /* fields omitted */ }
A Websocket builder for testing filters.
See module documentation for an overview.
Implementations
impl WsBuilder
[src]
impl WsBuilder
[src]pub fn header<K, V>(self, key: K, value: V) -> WsBuilder where
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
[src]
pub fn header<K, V>(self, key: K, value: V) -> WsBuilder where
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
[src]pub async fn handshake<F>(self, f: F) -> Result<WsClient, WsError> where
F: Filter + Clone + Send + Sync + 'static,
<F as FilterBase>::Extract: Reply,
<F as FilterBase>::Extract: Send,
<F as FilterBase>::Error: IsReject,
<F as FilterBase>::Error: Send,
[src]
pub async fn handshake<F>(self, f: F) -> Result<WsClient, WsError> where
F: Filter + Clone + Send + Sync + 'static,
<F as FilterBase>::Extract: Reply,
<F as FilterBase>::Extract: Send,
<F as FilterBase>::Error: IsReject,
<F as FilterBase>::Error: Send,
[src]Execute this Websocket request against the provided filter.
If the handshake succeeds, returns a WsClient
.
Example
use futures::future; use warp::Filter; #[tokio::main] // Some route that accepts websockets (but drops them immediately). let route = warp::ws() .map(|ws: warp::ws::Ws| { ws.on_upgrade(|_| future::ready(())) }); let client = warp::test::ws() .handshake(route) .await .expect("handshake");
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for WsBuilder
impl Send for WsBuilder
impl Sync for WsBuilder
impl Unpin for WsBuilder
impl !UnwindSafe for WsBuilder
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,