Struct deno_core::JsRuntimeInspector
source · pub struct JsRuntimeInspector { /* private fields */ }
Expand description
This structure is used responsible for providing inspector interface
to the JsRuntime
.
It stores an instance of v8::inspector::V8Inspector
and additionally
implements v8::inspector::V8InspectorClientImpl
.
After creating this structure it’s possible to connect multiple sessions to the inspector, in case of Deno it’s either: a “websocket session” that provides integration with Chrome Devtools, or an “in-memory session” that is used for REPL or converage collection.
Implementations§
source§impl JsRuntimeInspector
impl JsRuntimeInspector
pub fn new(
isolate: &mut OwnedIsolate,
context: Global<Context>
) -> Rc<RefCell<Self>>
pub fn has_active_sessions(&self) -> bool
sourcepub fn wait_for_session_and_break_on_next_statement(&mut self)
pub fn wait_for_session_and_break_on_next_statement(&mut self)
This function blocks the thread until at least one inspector client has established a websocket connection.
After that, it instructs V8 to pause at the next statement. Frontend must send “Runtime.runIfWaitingForDebugger” message to resume execution.
sourcepub fn get_session_sender(&self) -> UnboundedSender<InspectorSessionProxy>
pub fn get_session_sender(&self) -> UnboundedSender<InspectorSessionProxy>
Obtain a sender for proxy channels.
sourcepub fn add_deregister_handler(&mut self) -> Receiver<()>
pub fn add_deregister_handler(&mut self) -> Receiver<()>
Create a channel that notifies the frontend when inspector is dropped.
NOTE: Only a single handler is currently available.
sourcepub fn create_local_session(&self) -> LocalInspectorSession
pub fn create_local_session(&self) -> LocalInspectorSession
Create a local inspector session that can be used on the same thread as the isolate.
Trait Implementations§
source§impl Drop for JsRuntimeInspector
impl Drop for JsRuntimeInspector
source§impl Future for JsRuntimeInspector
impl Future for JsRuntimeInspector
Polling JsRuntimeInspector
allows inspector to accept new incoming
connections and “pump” messages in different sessions.
It should be polled on tick of event loop, ie. in JsRuntime::poll_event_loop
function.
source§impl V8InspectorClientImpl for JsRuntimeInspector
impl V8InspectorClientImpl for JsRuntimeInspector
fn base(&self) -> &V8InspectorClientBase
fn base_mut(&mut self) -> &mut V8InspectorClientBase
fn run_message_loop_on_pause(&mut self, context_group_id: i32)
fn quit_message_loop_on_pause(&mut self)
fn run_if_waiting_for_debugger(&mut self, context_group_id: i32)
fn generate_unique_id(&mut self) -> i64
fn console_api_message(
&mut self,
context_group_id: i32,
level: i32,
message: &StringView<'_>,
url: &StringView<'_>,
line_number: u32,
column_number: u32,
stack_trace: &mut V8StackTrace
)
Auto Trait Implementations§
impl !RefUnwindSafe for JsRuntimeInspector
impl !Send for JsRuntimeInspector
impl !Sync for JsRuntimeInspector
impl Unpin for JsRuntimeInspector
impl !UnwindSafe for JsRuntimeInspector
Blanket Implementations§
source§impl<T> AsV8InspectorClient for Twhere
T: V8InspectorClientImpl,
impl<T> AsV8InspectorClient for Twhere
T: V8InspectorClientImpl,
fn as_client(&self) -> &V8InspectorClient
fn as_client_mut(&mut self) -> &mut V8InspectorClient
source§impl<T> FutureExt for Twhere
T: Future + ?Sized,
impl<T> FutureExt for Twhere
T: Future + ?Sized,
source§fn map<U, F>(self, f: F) -> Map<Self, F>where
F: FnOnce(Self::Output) -> U,
Self: Sized,
fn map<U, F>(self, f: F) -> Map<Self, F>where
F: FnOnce(Self::Output) -> U,
Self: Sized,
source§fn map_into<U>(self) -> MapInto<Self, U>where
Self::Output: Into<U>,
Self: Sized,
fn map_into<U>(self) -> MapInto<Self, U>where
Self::Output: Into<U>,
Self: Sized,
source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>where
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
Self: Sized,
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>where
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
Self: Sized,
f
. Read moresource§fn left_future<B>(self) -> Either<Self, B>where
B: Future<Output = Self::Output>,
Self: Sized,
fn left_future<B>(self) -> Either<Self, B>where
B: Future<Output = Self::Output>,
Self: Sized,
source§fn right_future<A>(self) -> Either<A, Self>where
A: Future<Output = Self::Output>,
Self: Sized,
fn right_future<A>(self) -> Either<A, Self>where
A: Future<Output = Self::Output>,
Self: Sized,
source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
source§fn flatten(self) -> Flatten<Self>where
Self::Output: Future,
Self: Sized,
fn flatten(self) -> Flatten<Self>where
Self::Output: Future,
Self: Sized,
source§fn flatten_stream(self) -> FlattenStream<Self>where
Self::Output: Stream,
Self: Sized,
fn flatten_stream(self) -> FlattenStream<Self>where
Self::Output: Stream,
Self: Sized,
source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
poll
will never again be called once it has
completed. This method can be used to turn any Future
into a
FusedFuture
. Read moresource§fn inspect<F>(self, f: F) -> Inspect<Self, F>where
F: FnOnce(&Self::Output),
Self: Sized,
fn inspect<F>(self, f: F) -> Inspect<Self, F>where
F: FnOnce(&Self::Output),
Self: Sized,
source§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
source§fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
()
on completion and sends
its output to another future on a separate task. Read moresource§fn boxed<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a, Global>>where
Self: Sized + Send + 'a,
fn boxed<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a, Global>>where
Self: Sized + Send + 'a,
source§fn boxed_local<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a, Global>>where
Self: Sized + 'a,
fn boxed_local<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a, Global>>where
Self: Sized + 'a,
source§fn unit_error(self) -> UnitError<Self>where
Self: Sized,
fn unit_error(self) -> UnitError<Self>where
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = ()
>.source§fn never_error(self) -> NeverError<Self>where
Self: Sized,
fn never_error(self) -> NeverError<Self>where
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = Never
>.