pub struct WebSocketService { /* private fields */ }
Implementations§
Source§impl WebSocketService
impl WebSocketService
pub fn open<S, R>( url: impl AsRef<str>, send_callback: impl Fn(Result<(), WebSocketError>) -> S + 'static, receive_callback: impl Fn(Result<Message, WebSocketError>) -> R + 'static, close_send_callback: impl FnOnce() + 'static, close_receive_callback: impl FnOnce() + 'static, ) -> Result<Self, JsError>
pub fn send(&mut self, msg: Message) -> Result<(), TrySendError<Message>>
Trait Implementations§
Source§impl Clone for WebSocketService
impl Clone for WebSocketService
Source§fn clone(&self) -> WebSocketService
fn clone(&self) -> WebSocketService
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for WebSocketService
impl !RefUnwindSafe for WebSocketService
impl Send for WebSocketService
impl Sync for WebSocketService
impl Unpin for WebSocketService
impl !UnwindSafe for WebSocketService
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