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 coverage collection.

Implementations§

source§

impl JsRuntimeInspector

source

pub fn new( scope: &mut HandleScope<'_>, context: Local<'_, Context>, is_main_runtime: bool ) -> Rc<RefCell<Self>>

source

pub fn is_dispatching_message(&self) -> bool

source

pub fn context_destroyed( &mut self, scope: &mut HandleScope<'_>, context: Global<Context> )

source

pub fn exception_thrown( &self, scope: &mut HandleScope<'_>, exception: Local<'_, Value>, in_promise: bool )

source

pub fn has_active_sessions(&self) -> bool

source

pub fn has_blocking_sessions(&self) -> bool

source

pub fn poll_sessions( &self, invoker_cx: Option<&mut Context<'_>> ) -> Result<Poll<()>, BorrowMutError>

source

pub fn wait_for_session(&mut self)

This function blocks the thread until at least one inspector client has established a websocket connection.

source

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.

source

pub fn get_session_sender(&self) -> UnboundedSender<InspectorSessionProxy>

Obtain a sender for proxy channels.

source

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.

source

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

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl V8InspectorClientImpl for JsRuntimeInspector

source§

fn base(&self) -> &V8InspectorClientBase

source§

unsafe fn base_ptr(this: *const Self) -> *const V8InspectorClientBase
where Self: Sized,

This is used for calculating the offset to the base field, and care must be taken not to create any references in the process of creating the pointer because the *const Self pointer is not valid (thus resulting in instant UB)
source§

fn base_mut(&mut self) -> &mut V8InspectorClientBase

source§

fn run_message_loop_on_pause(&mut self, context_group_id: i32)

source§

fn quit_message_loop_on_pause(&mut self)

source§

fn run_if_waiting_for_debugger(&mut self, context_group_id: i32)

source§

fn generate_unique_id(&mut self) -> i64

source§

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§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsV8InspectorClient for T

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.