Struct ClientRequestBuilder
struct ClientRequestBuilder { ... }
Builder for a custom IntoClientRequest with options to add
custom additional headers and sub protocols.
Example
# use crate::*;
use Uri;
use ;
let uri: Uri = "ws://localhost:3012/socket".parse.unwrap;
let token = "my_jwt_token";
let builder = new
.with_header
.with_sub_protocol;
let socket = connect.unwrap;
Implementations
impl ClientRequestBuilder
const fn new(uri: Uri) -> SelfInitializes an empty request builder
fn with_header<K, V>(self: Self, key: K, value: V) -> Self where K: Into<String>, V: Into<String>Adds (
key,value) as an additional header to the handshake requestfn with_sub_protocol<P>(self: Self, protocol: P) -> Self where P: Into<String>Adds
protocolto the handshake request subprotocols (Sec-WebSocket-Protocol)
impl Clone for ClientRequestBuilder
fn clone(self: &Self) -> ClientRequestBuilder
impl Debug for ClientRequestBuilder
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Freeze for ClientRequestBuilder
impl IntoClientRequest for ClientRequestBuilder
fn into_client_request(self: Self) -> Result<Request>
impl RefUnwindSafe for ClientRequestBuilder
impl Send for ClientRequestBuilder
impl Sync for ClientRequestBuilder
impl Unpin for ClientRequestBuilder
impl UnsafeUnpin for ClientRequestBuilder
impl UnwindSafe for ClientRequestBuilder
impl<T> Any for ClientRequestBuilder
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for ClientRequestBuilder
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for ClientRequestBuilder
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for ClientRequestBuilder
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for ClientRequestBuilder
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Same for ClientRequestBuilder
impl<T> ToOwned for ClientRequestBuilder
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for ClientRequestBuilder
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for ClientRequestBuilder
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for ClientRequestBuilder
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<V, T> VZip for ClientRequestBuilder
fn vzip(self: Self) -> V