Struct soket::handshake::client::Client[][src]

pub struct Client<'a, T> { /* fields omitted */ }

Websocket client handshake.

Implementations

impl<'a, T: AsyncRead + AsyncWrite + Unpin> Client<'a, T>[src]

pub fn new(socket: T, host: &'a str, resource: &'a str) -> Self[src]

Create a new client handshake for some host and resource.

pub fn set_buffer(&mut self, b: BytesMut) -> &mut Self[src]

Override the buffer to use for request/response handling.

pub fn take_buffer(&mut self) -> BytesMut[src]

Extract the buffer.

pub fn set_origin(&mut self, o: &'a str) -> &mut Self[src]

Set the handshake origin header.

pub fn add_protocol(&mut self, p: &'a str) -> &mut Self[src]

Add a protocol to be included in the handshake.

pub fn add_extension(&mut self, e: Box<dyn Extension + Send>) -> &mut Self[src]

Add an extension to be included in the handshake.

pub fn drain_extensions(
    &mut self
) -> impl Iterator<Item = Box<dyn Extension + Send>> + '_
[src]

Get back all extensions.

pub async fn handshake(&mut self) -> Result<ServerResponse, Error>[src]

Initiate client handshake request to server and get back the response.

pub fn into_builder(self) -> Builder<T>[src]

Turn this handshake into a connection::Builder.

pub fn into_inner(self) -> T[src]

Get out the inner socket of the client.

Trait Implementations

impl<'a, T: Debug> Debug for Client<'a, T>[src]

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for Client<'a, T>

impl<'a, T> Send for Client<'a, T> where
    T: Send

impl<'a, T> !Sync for Client<'a, T>

impl<'a, T> Unpin for Client<'a, T> where
    T: Unpin

impl<'a, T> !UnwindSafe for Client<'a, T>

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,