pub struct RuntimeClient { /* private fields */ }Expand description
Client for Runtime domain commands.
Implementations§
Source§impl RuntimeClient
impl RuntimeClient
Sourcepub async fn await_promise(
&self,
params: AwaitPromiseParams,
session_id: Option<&str>,
) -> Result<AwaitPromiseReturns, CdpError>
pub async fn await_promise( &self, params: AwaitPromiseParams, session_id: Option<&str>, ) -> Result<AwaitPromiseReturns, CdpError>
Add handler to promise with given promise object id.
Sourcepub async fn call_function_on(
&self,
params: CallFunctionOnParams,
session_id: Option<&str>,
) -> Result<CallFunctionOnReturns, CdpError>
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.
Sourcepub async fn compile_script(
&self,
params: CompileScriptParams,
session_id: Option<&str>,
) -> Result<CompileScriptReturns, CdpError>
pub async fn compile_script( &self, params: CompileScriptParams, session_id: Option<&str>, ) -> Result<CompileScriptReturns, CdpError>
Compiles expression.
Sourcepub async fn disable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
pub async fn disable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
Disables reporting of execution contexts creation.
Sourcepub async fn discard_console_entries(
&self,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn discard_console_entries( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>
Discards collected exceptions and console API calls.
Sourcepub async fn enable(&self, session_id: Option<&str>) -> Result<Value, CdpError>
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.
Sourcepub async fn evaluate(
&self,
params: EvaluateParams,
session_id: Option<&str>,
) -> Result<EvaluateReturns, CdpError>
pub async fn evaluate( &self, params: EvaluateParams, session_id: Option<&str>, ) -> Result<EvaluateReturns, CdpError>
Evaluates expression on global object.
Sourcepub async fn get_isolate_id(
&self,
session_id: Option<&str>,
) -> Result<GetIsolateIdReturns, CdpError>
pub async fn get_isolate_id( &self, session_id: Option<&str>, ) -> Result<GetIsolateIdReturns, CdpError>
Returns the isolate id.
Sourcepub async fn get_heap_usage(
&self,
session_id: Option<&str>,
) -> Result<GetHeapUsageReturns, CdpError>
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.
Sourcepub async fn get_properties(
&self,
params: GetPropertiesParams,
session_id: Option<&str>,
) -> Result<GetPropertiesReturns, CdpError>
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.
Sourcepub async fn global_lexical_scope_names(
&self,
params: GlobalLexicalScopeNamesParams,
session_id: Option<&str>,
) -> Result<GlobalLexicalScopeNamesReturns, CdpError>
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.
pub async fn query_objects( &self, params: QueryObjectsParams, session_id: Option<&str>, ) -> Result<QueryObjectsReturns, CdpError>
Sourcepub async fn release_object(
&self,
params: ReleaseObjectParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
pub async fn release_object( &self, params: ReleaseObjectParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Releases remote object with given id.
Sourcepub async fn release_object_group(
&self,
params: ReleaseObjectGroupParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
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.
Sourcepub async fn run_if_waiting_for_debugger(
&self,
session_id: Option<&str>,
) -> Result<Value, CdpError>
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.
Sourcepub async fn run_script(
&self,
params: RunScriptParams,
session_id: Option<&str>,
) -> Result<RunScriptReturns, CdpError>
pub async fn run_script( &self, params: RunScriptParams, session_id: Option<&str>, ) -> Result<RunScriptReturns, CdpError>
Runs script with given id in a given context.
Sourcepub async fn set_async_call_stack_depth(
&self,
params: SetAsyncCallStackDepthParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
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.
pub async fn set_custom_object_formatter_enabled( &self, params: SetCustomObjectFormatterEnabledParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
pub async fn set_max_call_stack_size_to_capture( &self, params: SetMaxCallStackSizeToCaptureParams, session_id: Option<&str>, ) -> Result<Value, CdpError>
Sourcepub async fn terminate_execution(
&self,
session_id: Option<&str>,
) -> Result<Value, CdpError>
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.
Sourcepub async fn add_binding(
&self,
params: AddBindingParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
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.
Sourcepub async fn remove_binding(
&self,
params: RemoveBindingParams,
session_id: Option<&str>,
) -> Result<Value, CdpError>
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.
Sourcepub async fn get_exception_details(
&self,
params: GetExceptionDetailsParams,
session_id: Option<&str>,
) -> Result<GetExceptionDetailsReturns, CdpError>
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.