pub struct WsSender { /* private fields */ }Expand description
The sending half of a WebSocket.
Implementations§
Source§impl WsSender
impl WsSender
Sourcepub fn send_async(
&self,
message: Message,
done: impl FnOnce(Result<(), HttpError>) + Send + 'static,
)
pub fn send_async( &self, message: Message, done: impl FnOnce(Result<(), HttpError>) + Send + 'static, )
Send a message; done reports when the platform took it.
Sourcepub fn send_future(&self, message: Message) -> Oneshot<Result<(), HttpError>> ⓘ
pub fn send_future(&self, message: Message) -> Oneshot<Result<(), HttpError>> ⓘ
Send a message and await the platform taking it.
Sourcepub fn ping_async(
&self,
done: impl FnOnce(Result<(), HttpError>) + Send + 'static,
)
pub fn ping_async( &self, done: impl FnOnce(Result<(), HttpError>) + Send + 'static, )
Send a ping; done reports the pong. Needs Capabilities::websocket_ping.
Trait Implementations§
Auto Trait Implementations§
impl Forget for WsSender
impl Freeze for WsSender
impl Move for WsSender
impl RefUnwindSafe for WsSender
impl Send for WsSender
impl Sync for WsSender
impl Unpin for WsSender
impl UnsafeUnpin for WsSender
impl UnwindSafe for WsSender
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