Struct maia_wasm::websocket::WebSocketClient
source · pub struct WebSocketClient {}Expand description
WebSocket client for waterfall data.
Implements a WebSocket client that receives messages containing waterfall data and submits the data to the waterfall by calling Waterfall::put_waterfall_spectrum.
Implementations§
source§impl WebSocketClient
impl WebSocketClient
sourcepub fn start(
window: &Window,
waterfall: Rc<RefCell<Waterfall>>
) -> Result<(), JsValue>
pub fn start( window: &Window, waterfall: Rc<RefCell<Waterfall>> ) -> Result<(), JsValue>
Starts the WebSocket client.
The client is given shared mutable access to the Waterfall.
This function creates and registers the appropriate on-message handler
for the WebSocket client. No further interaction with the
WebSocketClient returned by this function is needed and it can be
dropped immediately.
Auto Trait Implementations§
impl Freeze for WebSocketClient
impl RefUnwindSafe for WebSocketClient
impl Send for WebSocketClient
impl Sync for WebSocketClient
impl Unpin for WebSocketClient
impl UnwindSafe for WebSocketClient
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