Struct wasm_web_helpers::websocket::WebSocketService
source · [−]pub struct WebSocketService { /* private fields */ }
Implementations
sourceimpl 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> where
S: Into<ControlFlow>,
R: Into<ControlFlow>,
pub fn send(&mut self, msg: Message) -> Result<(), TrySendError<Message>>
Trait Implementations
sourceimpl Clone for WebSocketService
impl Clone for WebSocketService
sourcefn clone(&self) -> WebSocketService
fn clone(&self) -> WebSocketService
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for WebSocketService
impl Send for WebSocketService
impl Sync for WebSocketService
impl Unpin for WebSocketService
impl !UnwindSafe for WebSocketService
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more