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

pub struct WebsocketsRequest { /* fields omitted */ }

WebSocket connection

Methods

impl WebsocketsRequest[src]

pub fn address(self, addr: SocketAddr) -> Self[src]

Set socket address of the server.

This address is used for connection. If address is not provided url's host name get resolved.

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

Set supported websocket protocols

pub fn cookie(self, cookie: Cookie) -> 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 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>(self, username: U, password: Option<&str>) -> Self where
    U: 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.

Trait Implementations

impl Debug for WebsocketsRequest[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,