[−][src]Struct awc::ws::WebsocketsRequest
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]
U: IntoIterator<Item = V>,
V: AsRef<str>,
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]
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 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>(self, username: U, password: Option<&str>) -> Self where
U: Display,
[src]
U: 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.
Trait Implementations
Auto Trait Implementations
impl !Sync for WebsocketsRequest
impl !Send for WebsocketsRequest
impl Unpin for WebsocketsRequest
impl !RefUnwindSafe for WebsocketsRequest
impl !UnwindSafe for WebsocketsRequest
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,