[−][src]Struct awc::ws::WebsocketsRequest
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]
U: IntoIterator<Item = V> + 'static,
V: AsRef<str>,
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]
HeaderValue: HttpTryFrom<V>,
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]
HeaderName: HttpTryFrom<K>,
V: IntoHeaderValue,
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]
HeaderName: HttpTryFrom<K>,
V: IntoHeaderValue,
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]
HeaderName: HttpTryFrom<K>,
V: IntoHeaderValue,
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]
U: Display,
P: Display,
Set HTTP basic authorization header
pub fn bearer_auth<T>(self, token: T) -> Self where
T: Display,
[src]
T: Display,
Set HTTP bearer authentication header
pub fn connect(
self
) -> impl Future<Item = (ClientResponse, Framed<BoxedSocket, Codec>), Error = WsClientError>
[src]
self
) -> impl Future<Item = (ClientResponse, Framed<BoxedSocket, Codec>), Error = WsClientError>
Complete request construction and connect to a websockets server.
Auto Trait Implementations
impl !Send for WebsocketsRequest
impl !Sync for WebsocketsRequest
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.