Skip to main content

RuntimeClient

Struct RuntimeClient 

Source
pub struct RuntimeClient { /* private fields */ }
Expand description

Client for Runtime domain commands.

Implementations§

Source§

impl RuntimeClient

Source

pub async fn await_promise( &self, params: AwaitPromiseParams, session_id: Option<&str>, ) -> Result<AwaitPromiseReturns, CdpError>

Add handler to promise with given promise object id.

Source

pub async fn call_function_on( &self, params: CallFunctionOnParams, session_id: Option<&str>, ) -> Result<CallFunctionOnReturns, CdpError>

Calls function with given declaration on the given object. Object group of the result is inherited from the target object.

Source

pub async fn compile_script( &self, params: CompileScriptParams, session_id: Option<&str>, ) -> Result<CompileScriptReturns, CdpError>

Compiles expression.

Source

pub async fn disable(&self, session_id: Option<&str>) -> Result<Value, CdpError>

Disables reporting of execution contexts creation.

Source

pub async fn discard_console_entries( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>

Discards collected exceptions and console API calls.

Source

pub async fn enable(&self, session_id: Option<&str>) -> Result<Value, CdpError>

Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context.

Source

pub async fn evaluate( &self, params: EvaluateParams, session_id: Option<&str>, ) -> Result<EvaluateReturns, CdpError>

Evaluates expression on global object.

Source

pub async fn get_isolate_id( &self, session_id: Option<&str>, ) -> Result<GetIsolateIdReturns, CdpError>

Returns the isolate id.

Source

pub async fn get_heap_usage( &self, session_id: Option<&str>, ) -> Result<GetHeapUsageReturns, CdpError>

Returns the JavaScript heap usage. It is the total usage of the corresponding isolate not scoped to a particular Runtime.

Source

pub async fn get_properties( &self, params: GetPropertiesParams, session_id: Option<&str>, ) -> Result<GetPropertiesReturns, CdpError>

Returns properties of a given object. Object group of the result is inherited from the target object.

Source

pub async fn global_lexical_scope_names( &self, params: GlobalLexicalScopeNamesParams, session_id: Option<&str>, ) -> Result<GlobalLexicalScopeNamesReturns, CdpError>

Returns all let, const and class variables from global scope.

Source

pub async fn query_objects( &self, params: QueryObjectsParams, session_id: Option<&str>, ) -> Result<QueryObjectsReturns, CdpError>

Source

pub async fn release_object( &self, params: ReleaseObjectParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Releases remote object with given id.

Source

pub async fn release_object_group( &self, params: ReleaseObjectGroupParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Releases all remote objects that belong to a given group.

Source

pub async fn run_if_waiting_for_debugger( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>

Tells inspected instance to run if it was waiting for debugger to attach.

Source

pub async fn run_script( &self, params: RunScriptParams, session_id: Option<&str>, ) -> Result<RunScriptReturns, CdpError>

Runs script with given id in a given context.

Source

pub async fn set_async_call_stack_depth( &self, params: SetAsyncCallStackDepthParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Enables or disables async call stacks tracking.

Source

pub async fn set_custom_object_formatter_enabled( &self, params: SetCustomObjectFormatterEnabledParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Source

pub async fn set_max_call_stack_size_to_capture( &self, params: SetMaxCallStackSizeToCaptureParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Source

pub async fn terminate_execution( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>

Terminate current or next JavaScript execution. Will cancel the termination when the outer-most script execution ends.

Source

pub async fn add_binding( &self, params: AddBindingParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

If executionContextId is empty, adds binding with the given name on the global objects of all inspected contexts, including those created later, bindings survive reloads. Binding function takes exactly one argument, this argument should be string, in case of any other input, function throws an exception. Each binding function call produces Runtime.bindingCalled notification.

Source

pub async fn remove_binding( &self, params: RemoveBindingParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

This method does not remove binding function from global object but unsubscribes current runtime agent from Runtime.bindingCalled notifications.

Source

pub async fn get_exception_details( &self, params: GetExceptionDetailsParams, session_id: Option<&str>, ) -> Result<GetExceptionDetailsReturns, CdpError>

This method tries to lookup and populate exception details for a JavaScript Error object. Note that the stackTrace portion of the resulting exceptionDetails will only be populated if the Runtime domain was enabled at the time when the Error was thrown.

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> 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more