Struct soketto::connection::Sender
source · [−]pub struct Sender<T> { /* private fields */ }
Expand description
The sending half of a connection.
Implementations
sourceimpl<T: AsyncRead + AsyncWrite + Unpin> Sender<T>
impl<T: AsyncRead + AsyncWrite + Unpin> Sender<T>
sourcepub async fn send_text(&mut self, data: impl AsRef<str>) -> Result<(), Error>
pub async fn send_text(&mut self, data: impl AsRef<str>) -> Result<(), Error>
Send a text value over the websocket connection.
sourcepub async fn send_binary(&mut self, data: impl AsRef<[u8]>) -> Result<(), Error>
pub async fn send_binary(&mut self, data: impl AsRef<[u8]>) -> Result<(), Error>
Send some binary data over the websocket connection.
sourcepub async fn send_binary_mut(
&mut self,
data: impl AsMut<[u8]>
) -> Result<(), Error>
pub async fn send_binary_mut(
&mut self,
data: impl AsMut<[u8]>
) -> Result<(), Error>
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.
sourcepub async fn send_ping(&mut self, data: ByteSlice125<'_>) -> Result<(), Error>
pub async fn send_ping(&mut self, data: ByteSlice125<'_>) -> Result<(), Error>
Ping the remote end.
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more