Struct soketto::connection::Sender
source · pub struct Sender<T> { /* private fields */ }
Expand description
The sending half of a connection.
Implementations§
source§impl<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_text_owned(&mut self, data: String) -> Result<(), Error>
pub async fn send_text_owned(&mut self, data: String) -> Result<(), Error>
Send a text value over the websocket connection.
This method performs one copy fewer than Sender::send_text
.
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.
This method performs one copy fewer than Sender::send_binary
.
The data
buffer may be modified by this method, 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more