/// Returns a future that receives messages from the websocket and dispatches
/// them to the V8 session.
Returns a future that receives messages from the websocket and dispatches
them to the V8 session.
Returns a future that receives messages from the websocket and dispatches them to the V8 session .
fn receive_from_websocket(
    self_ptr: *mut Self,
    websocket_rx: WebSocketProxyReceiver,
  ) -> Pin<Box<dyn Future<Output = ()> + 'static>> {
    async move {
      eprintln!("Debugger session started.");
      let result = websocket_rx
        .map_ok(move |msg| {
          let msg = msg.into_data();
          let msg = v8::inspector::StringView::from(msg.as_slice());
          unsafe { &mut *self_ptr }.dispatch_protocol_message(msg);
        })
        .try_collect::<()>()
        .await;
      match result {
        Ok(_) => eprintln!("Debugger session ended."),
        Err(err) => eprintln!("Debugger session ended: {}.", err),
      };
    }
    .boxed_local()
  }
fn receive_from_websocket ( self_ptr : * mut Self , websocket_rx : WebSocketProxyReceiver , ) -> Pin < Box < dyn Future < Output = ( ) > + ' static > > { async move { eprintln ! ( " " ) ; let result = websocket_rx . map_ok ( move | msg | { let msg = msg . into_data ( ) ; let msg = v8 :: inspector :: StringView :: from ( msg . as_slice ( ) ) ; unsafe { & mut * self_ptr } . dispatch_protocol_message ( msg ) ; } ) . try_collect :: < ( ) > ( ) . await ; match result { Ok ( _ ) => eprintln ! ( " " ) , Err ( err ) => eprintln ! ( " " err ) , } ; } . boxed_local ( ) }
Returns a future that receives messages from the websocket and dispatches
them to the V8 session.
Returns a future that receives messages from the websocket and dispatches them to the V8 session .
self_ptr
*mut Self
websocket_rx
WebSocketProxyReceiver