Struct soket::connection::Sender[][src]

pub struct Sender<T> { /* fields omitted */ }

The sending half of a connection.

Implementations

impl<T: AsyncRead + AsyncWrite + Unpin> Sender<T>[src]

pub async fn send_text(&mut self, data: impl AsRef<str>) -> Result<(), Error>[src]

Send a text value over the websocket connection.

pub async fn send_binary(&mut self, data: impl AsRef<[u8]>) -> Result<(), Error>[src]

Send some binary data over the websocket connection.

pub async fn send_binary_mut(
    &mut self,
    data: impl AsMut<[u8]>
) -> Result<(), Error>
[src]

Send some binary data over the websocket connection.

In contrast to Sender::send_binary the provided data is modified in-place, e.g. if masking is necessary.

pub async fn send_ping(&mut self, data: ByteSlice125<'_>) -> Result<(), Error>[src]

Ping the remote end.

pub async fn send_pong(&mut self, data: ByteSlice125<'_>) -> Result<(), Error>[src]

Send an unsolicited Pong to the remote.

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

Flush the socket buffer.

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

Send a close message and close the connection.

Trait Implementations

impl<T: Debug> Debug for Sender<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Sender<T>

impl<T> Send for Sender<T> where
    T: Send

impl<T> Sync for Sender<T> where
    T: Send

impl<T> Unpin for Sender<T>

impl<T> !UnwindSafe for Sender<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>,