[][src]Struct soketto::handshake::server::Server

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

Websocket handshake client.

Methods

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

pub fn new(socket: T) -> Self[src]

Create a new server handshake.

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 add_protocol(&mut self, p: &'a str) -> &mut Self[src]

Add a protocol the server supports.

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

Add an extension the server supports.

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

Get back all extensions.

pub async fn receive_request<'_>(
    &'_ mut self
) -> Result<ClientRequest<'a>, Error>
[src]

Await an incoming client handshake request.

pub async fn send_response<'_, '_, '_>(
    &'_ mut self,
    r: &'_ Response<'_>
) -> Result<(), Error>
[src]

Respond to the client.

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

Turn this handshake into a connection::Builder.

Trait Implementations

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

Auto Trait Implementations

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

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

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

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

impl<'a, T> !UnwindSafe for Server<'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, 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>,