pub struct Sender { /* private fields */ }Expand description
Sender handle for sending messages
Implementations§
Source§impl Sender
impl Sender
Sourcepub fn send_binary(&self, data: impl Into<Vec<u8>>) -> Result<(), SendError>
pub fn send_binary(&self, data: impl Into<Vec<u8>>) -> Result<(), SendError>
Send a binary message
Sourcepub async fn send_async(&self, message: Message) -> Result<(), SendError>
pub async fn send_async(&self, message: Message) -> Result<(), SendError>
Send a message (async, blocking on capacity)
Sourcepub async fn send_text_async(
&self,
text: impl Into<String>,
) -> Result<(), SendError>
pub async fn send_text_async( &self, text: impl Into<String>, ) -> Result<(), SendError>
Send a text message (async)
Sourcepub async fn send_binary_async(
&self,
data: impl Into<Vec<u8>>,
) -> Result<(), SendError>
pub async fn send_binary_async( &self, data: impl Into<Vec<u8>>, ) -> Result<(), SendError>
Send a binary message (async)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sender
impl RefUnwindSafe for Sender
impl Send for Sender
impl Sync for Sender
impl Unpin for Sender
impl UnwindSafe for Sender
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