[][src]Struct awc::ws::WebsocketsRequest

pub struct WebsocketsRequest { /* fields omitted */ }

WebSocket connection

Methods

impl WebsocketsRequest[src]

pub fn protocols<U, V>(self, protos: U) -> Self where
    U: IntoIterator<Item = V> + 'static,
    V: AsRef<str>, 
[src]

Set supported websocket protocols

pub fn cookie<'c>(self, cookie: Cookie<'c>) -> Self[src]

Set a cookie

pub fn origin<V>(self, origin: V) -> Self where
    HeaderValue: HttpTryFrom<V>, 
[src]

Set request Origin

pub fn max_frame_size(self, size: usize) -> Self[src]

Set max frame size

By default max size is set to 64kb

pub fn server_mode(self) -> Self[src]

Disable payload masking. By default ws client masks frame payload.

pub fn no_default_headers(self) -> Self[src]

Do not add default request headers. By default Date and User-Agent headers are set.

pub fn header<K, V>(self, key: K, value: V) -> Self where
    HeaderName: HttpTryFrom<K>,
    V: IntoHeaderValue, 
[src]

Append a header.

Header gets appended to existing header. To override header use set_header() method.

pub fn set_header<K, V>(self, key: K, value: V) -> Self where
    HeaderName: HttpTryFrom<K>,
    V: IntoHeaderValue, 
[src]

Insert a header, replaces existing header.

pub fn set_header_if_none<K, V>(self, key: K, value: V) -> Self where
    HeaderName: HttpTryFrom<K>,
    V: IntoHeaderValue, 
[src]

Insert a header only if it is not yet set.

pub fn basic_auth<U, P>(self, username: U, password: Option<P>) -> Self where
    U: Display,
    P: Display
[src]

Set HTTP basic authorization header

pub fn bearer_auth<T>(self, token: T) -> Self where
    T: Display
[src]

Set HTTP bearer authentication header

pub fn connect(
    self
) -> impl Future<Item = (ClientResponse, Framed<BoxedSocket, Codec>), Error = WsClientError>
[src]

Complete request construction and connect to a websockets server.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T