_cef_dev_tools_message_observer_t

Struct _cef_dev_tools_message_observer_t 

Source
#[repr(C)]
pub struct _cef_dev_tools_message_observer_t { pub base: cef_base_ref_counted_t, pub on_dev_tools_message: Option<unsafe extern "C" fn(self_: *mut _cef_dev_tools_message_observer_t, browser: *mut _cef_browser_t, message: *const c_void, message_size: usize) -> c_int>, pub on_dev_tools_method_result: Option<unsafe extern "C" fn(self_: *mut _cef_dev_tools_message_observer_t, browser: *mut _cef_browser_t, message_id: c_int, success: c_int, result: *const c_void, result_size: usize)>, pub on_dev_tools_event: Option<unsafe extern "C" fn(self_: *mut _cef_dev_tools_message_observer_t, browser: *mut _cef_browser_t, method: *const cef_string_t, params: *const c_void, params_size: usize)>, pub on_dev_tools_agent_attached: Option<unsafe extern "C" fn(self_: *mut _cef_dev_tools_message_observer_t, browser: *mut _cef_browser_t)>, pub on_dev_tools_agent_detached: Option<unsafe extern "C" fn(self_: *mut _cef_dev_tools_message_observer_t, browser: *mut _cef_browser_t)>, }
Expand description

Callback structure for cef_browser_host_t::AddDevToolsMessageObserver. The functions of this structure will be called on the browser process UI thread.

NOTE: This struct is allocated client-side.

Fields§

§base: cef_base_ref_counted_t

Base structure.

§on_dev_tools_message: Option<unsafe extern "C" fn(self_: *mut _cef_dev_tools_message_observer_t, browser: *mut _cef_browser_t, message: *const c_void, message_size: usize) -> c_int>

Method that will be called on receipt of a DevTools protocol message. |browser| is the originating browser instance. |message| is a UTF8-encoded JSON dictionary representing either a function result or an event. |message| is only valid for the scope of this callback and should be copied if necessary. Return true (1) if the message was handled or false (0) if the message should be further processed and passed to the OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate.

Method result dictionaries include an “id” (int) value that identifies the orginating function call sent from cef_browser_host_t::SendDevToolsMessage, and optionally either a “result” (dictionary) or “error” (dictionary) value. The “error” dictionary will contain “code” (int) and “message” (string) values. Event dictionaries include a “function” (string) value and optionally a “params” (dictionary) value. See the DevTools protocol documentation at https://chromedevtools.github.io/devtools-protocol/ for details of supported function calls and the expected “result” or “params” dictionary contents. JSON dictionaries can be parsed using the CefParseJSON function if desired, however be aware of performance considerations when parsing large messages (some of which may exceed 1MB in size).

§on_dev_tools_method_result: Option<unsafe extern "C" fn(self_: *mut _cef_dev_tools_message_observer_t, browser: *mut _cef_browser_t, message_id: c_int, success: c_int, result: *const c_void, result_size: usize)>

Method that will be called after attempted execution of a DevTools protocol function. |browser| is the originating browser instance. |message_id| is the “id” value that identifies the originating function call message. If the function succeeded |success| will be true (1) and |result| will be the UTF8-encoded JSON “result” dictionary value (which may be NULL). If the function failed |success| will be false (0) and |result| will be the UTF8-encoded JSON “error” dictionary value. |result| is only valid for the scope of this callback and should be copied if necessary. See the OnDevToolsMessage documentation for additional details on |result| contents.

§on_dev_tools_event: Option<unsafe extern "C" fn(self_: *mut _cef_dev_tools_message_observer_t, browser: *mut _cef_browser_t, method: *const cef_string_t, params: *const c_void, params_size: usize)>

Method that will be called on receipt of a DevTools protocol event. |browser| is the originating browser instance. |function| is the “function” value. |params| is the UTF8-encoded JSON “params” dictionary value (which may be NULL). |params| is only valid for the scope of this callback and should be copied if necessary. See the OnDevToolsMessage documentation for additional details on |params| contents.

§on_dev_tools_agent_attached: Option<unsafe extern "C" fn(self_: *mut _cef_dev_tools_message_observer_t, browser: *mut _cef_browser_t)>

Method that will be called when the DevTools agent has attached. |browser| is the originating browser instance. This will generally occur in response to the first message sent while the agent is detached.

§on_dev_tools_agent_detached: Option<unsafe extern "C" fn(self_: *mut _cef_dev_tools_message_observer_t, browser: *mut _cef_browser_t)>

Method that will be called when the DevTools agent has detached. |browser| is the originating browser instance. Any function results that were pending before the agent became detached will not be delivered, and any active event subscriptions will be canceled.

Trait Implementations§

Source§

impl Clone for _cef_dev_tools_message_observer_t

Source§

fn clone(&self) -> _cef_dev_tools_message_observer_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for _cef_dev_tools_message_observer_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for _cef_dev_tools_message_observer_t

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.