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
impl JsRuntimeInspector
pub fn new( isolate_ptr: *mut Isolate, scope: &mut HandleScope<'_>, context: Local<'_, Context>, is_main_runtime: bool, ) -> Rc<RefCell<Self>>
pub fn is_dispatching_message(&self) -> bool
pub fn context_destroyed( &mut self, scope: &mut HandleScope<'_>, context: Global<Context>, )
pub fn exception_thrown( &self, scope: &mut HandleScope<'_>, exception: Local<'_, Value>, in_promise: bool, )
pub fn sessions_state(&self) -> SessionsState
pub fn poll_sessions( &self, invoker_cx: Option<&mut Context<'_>>, ) -> Result<Poll<()>, BorrowMutError>
Sourcepub fn wait_for_session(&mut self)
pub fn wait_for_session(&mut self)
This function blocks the thread until at least one inspector client has established a websocket connection.
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.
pub fn create_raw_session( &self, options: InspectorSessionOptions, send: Box<dyn Fn(InspectorMsg)>, ) -> UnboundedSender<String>
Sourcepub fn create_local_session(
&self,
options: InspectorSessionOptions,
) -> LocalInspectorSession
pub fn create_local_session( &self, options: InspectorSessionOptions, ) -> 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 V8InspectorClientImpl for JsRuntimeInspector
impl V8InspectorClientImpl for JsRuntimeInspector
fn base(&self) -> &V8InspectorClientBase
Source§unsafe fn base_ptr(this: *const Self) -> *const V8InspectorClientBasewhere
Self: Sized,
unsafe fn base_ptr(this: *const Self) -> *const V8InspectorClientBasewhere
Self: Sized,
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 ensure_default_context_in_group( &mut self, context_group_id: i32, ) -> Option<Local<'_, Context>>
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 !Freeze for JsRuntimeInspector
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> 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
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.