_cef_v8_value_t

Struct _cef_v8_value_t 

Source
#[repr(C)]
pub struct _cef_v8_value_t {
Show 53 fields pub base: cef_base_ref_counted_t, pub is_valid: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_undefined: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_null: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_bool: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_int: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_uint: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_double: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_date: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_string: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_object: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_array: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_array_buffer: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_function: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_promise: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub is_same: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, that: *mut _cef_v8_value_t) -> c_int>, pub get_bool_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub get_int_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> i32>, pub get_uint_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> u32>, pub get_double_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> f64>, pub get_date_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> cef_basetime_t>, pub get_string_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> cef_string_userfree_t>, pub is_user_created: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub has_exception: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub get_exception: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> *mut _cef_v8_exception_t>, pub clear_exception: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub will_rethrow_exceptions: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub set_rethrow_exceptions: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, rethrow: c_int) -> c_int>, pub has_value_bykey: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, key: *const cef_string_t) -> c_int>, pub has_value_byindex: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, index: c_int) -> c_int>, pub delete_value_bykey: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, key: *const cef_string_t) -> c_int>, pub delete_value_byindex: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, index: c_int) -> c_int>, pub get_value_bykey: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, key: *const cef_string_t) -> *mut _cef_v8_value_t>, pub get_value_byindex: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, index: c_int) -> *mut _cef_v8_value_t>, pub set_value_bykey: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, key: *const cef_string_t, value: *mut _cef_v8_value_t, attribute: cef_v8_propertyattribute_t) -> c_int>, pub set_value_byindex: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, index: c_int, value: *mut _cef_v8_value_t) -> c_int>, pub set_value_byaccessor: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, key: *const cef_string_t, attribute: cef_v8_propertyattribute_t) -> c_int>, pub get_keys: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, keys: cef_string_list_t) -> c_int>, pub set_user_data: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, user_data: *mut _cef_base_ref_counted_t) -> c_int>, pub get_user_data: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> *mut _cef_base_ref_counted_t>, pub get_externally_allocated_memory: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub adjust_externally_allocated_memory: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, change_in_bytes: c_int) -> c_int>, pub get_array_length: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub get_array_buffer_release_callback: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> *mut _cef_v8_array_buffer_release_callback_t>, pub neuter_array_buffer: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>, pub get_array_buffer_byte_length: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> usize>, pub get_array_buffer_data: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> *mut c_void>, pub get_function_name: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> cef_string_userfree_t>, pub get_function_handler: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> *mut _cef_v8_handler_t>, pub execute_function: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, object: *mut _cef_v8_value_t, argumentsCount: usize, arguments: *const *mut _cef_v8_value_t) -> *mut _cef_v8_value_t>, pub execute_function_with_context: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, context: *mut _cef_v8_context_t, object: *mut _cef_v8_value_t, argumentsCount: usize, arguments: *const *mut _cef_v8_value_t) -> *mut _cef_v8_value_t>, pub resolve_promise: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, arg: *mut _cef_v8_value_t) -> c_int>, pub reject_promise: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, errorMsg: *const cef_string_t) -> c_int>,
}
Expand description

Structure representing a V8 value handle. V8 handles can only be accessed from the thread on which they are created. Valid threads for creating a V8 handle include the render process main thread (TID_RENDERER) and WebWorker threads. A task runner for posting tasks on the associated thread can be retrieved via the cef_v8_context_t::get_task_runner() function.

NOTE: This struct is allocated DLL-side.

Fields§

§base: cef_base_ref_counted_t

Base structure.

§is_valid: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

Returns true (1) if the underlying handle is valid and it can be accessed on the current thread. Do not call any other functions if this function returns false (0).

§is_undefined: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is undefined.

§is_null: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is null.

§is_bool: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is bool.

§is_int: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is int.

§is_uint: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is unsigned int.

§is_double: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is double.

§is_date: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is Date.

§is_string: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is string.

§is_object: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is object.

§is_array: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is array.

§is_array_buffer: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is an ArrayBuffer.

§is_function: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is function.

§is_promise: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

True if the value type is a Promise.

§is_same: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, that: *mut _cef_v8_value_t) -> c_int>

Returns true (1) if this object is pointing to the same handle as |that| object.

§get_bool_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

Return a bool value.

§get_int_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> i32>

Return an int value.

§get_uint_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> u32>

Return an unsigned int value.

§get_double_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> f64>

Return a double value.

§get_date_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> cef_basetime_t>

Return a Date value.

§get_string_value: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> cef_string_userfree_t>

Return a string value.

§is_user_created: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

Returns true (1) if this is a user created object.

§has_exception: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

Returns true (1) if the last function call resulted in an exception. This attribute exists only in the scope of the current CEF value object.

§get_exception: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> *mut _cef_v8_exception_t>

Returns the exception resulting from the last function call. This attribute exists only in the scope of the current CEF value object.

§clear_exception: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

Clears the last exception and returns true (1) on success.

§will_rethrow_exceptions: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

Returns true (1) if this object will re-throw future exceptions. This attribute exists only in the scope of the current CEF value object.

§set_rethrow_exceptions: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, rethrow: c_int) -> c_int>

Set whether this object will re-throw future exceptions. By default exceptions are not re-thrown. If a exception is re-thrown the current context should not be accessed again until after the exception has been caught and not re-thrown. Returns true (1) on success. This attribute exists only in the scope of the current CEF value object.

§has_value_bykey: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, key: *const cef_string_t) -> c_int>

Returns true (1) if the object has a value with the specified identifier.

§has_value_byindex: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, index: c_int) -> c_int>

Returns true (1) if the object has a value with the specified identifier.

§delete_value_bykey: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, key: *const cef_string_t) -> c_int>

Deletes the value with the specified identifier and returns true (1) on success. Returns false (0) if this function is called incorrectly or an exception is thrown. For read-only and don’t-delete values this function will return true (1) even though deletion failed.

§delete_value_byindex: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, index: c_int) -> c_int>

Deletes the value with the specified identifier and returns true (1) on success. Returns false (0) if this function is called incorrectly, deletion fails or an exception is thrown. For read-only and don’t-delete values this function will return true (1) even though deletion failed.

§get_value_bykey: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, key: *const cef_string_t) -> *mut _cef_v8_value_t>

Returns the value with the specified identifier on success. Returns NULL if this function is called incorrectly or an exception is thrown.

§get_value_byindex: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, index: c_int) -> *mut _cef_v8_value_t>

Returns the value with the specified identifier on success. Returns NULL if this function is called incorrectly or an exception is thrown.

§set_value_bykey: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, key: *const cef_string_t, value: *mut _cef_v8_value_t, attribute: cef_v8_propertyattribute_t) -> c_int>

Associates a value with the specified identifier and returns true (1) on success. Returns false (0) if this function is called incorrectly or an exception is thrown. For read-only values this function will return true (1) even though assignment failed.

§set_value_byindex: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, index: c_int, value: *mut _cef_v8_value_t) -> c_int>

Associates a value with the specified identifier and returns true (1) on success. Returns false (0) if this function is called incorrectly or an exception is thrown. For read-only values this function will return true (1) even though assignment failed.

§set_value_byaccessor: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, key: *const cef_string_t, attribute: cef_v8_propertyattribute_t) -> c_int>

Registers an identifier and returns true (1) on success. Access to the identifier will be forwarded to the cef_v8_accessor_t instance passed to cef_v8_value_t::cef_v8_value_create_object(). Returns false (0) if this function is called incorrectly or an exception is thrown. For read-only values this function will return true (1) even though assignment failed.

§get_keys: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, keys: cef_string_list_t) -> c_int>

Read the keys for the object’s values into the specified vector. Integer- based keys will also be returned as strings.

§set_user_data: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, user_data: *mut _cef_base_ref_counted_t) -> c_int>

Sets the user data for this object and returns true (1) on success. Returns false (0) if this function is called incorrectly. This function can only be called on user created objects.

§get_user_data: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> *mut _cef_base_ref_counted_t>

Returns the user data, if any, assigned to this object.

§get_externally_allocated_memory: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

Returns the amount of externally allocated memory registered for the object.

§adjust_externally_allocated_memory: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, change_in_bytes: c_int) -> c_int>

Adjusts the amount of registered external memory for the object. Used to give V8 an indication of the amount of externally allocated memory that is kept alive by JavaScript objects. V8 uses this information to decide when to perform global garbage collection. Each cef_v8_value_t tracks the amount of external memory associated with it and automatically decreases the global total by the appropriate amount on its destruction. |change_in_bytes| specifies the number of bytes to adjust by. This function returns the number of bytes associated with the object after the adjustment. This function can only be called on user created objects.

§get_array_length: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

Returns the number of elements in the array.

§get_array_buffer_release_callback: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> *mut _cef_v8_array_buffer_release_callback_t>

Returns the ReleaseCallback object associated with the ArrayBuffer or NULL if the ArrayBuffer was not created with CreateArrayBuffer.

§neuter_array_buffer: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> c_int>

Prevent the ArrayBuffer from using it’s memory block by setting the length to zero. This operation cannot be undone. If the ArrayBuffer was created with CreateArrayBuffer then cef_v8_array_buffer_release_callback_t::ReleaseBuffer will be called to release the underlying buffer.

§get_array_buffer_byte_length: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> usize>

Returns the length (in bytes) of the ArrayBuffer.

§get_array_buffer_data: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> *mut c_void>

Returns a pointer to the beginning of the memory block for this ArrayBuffer backing store. The returned pointer is valid as long as the cef_v8_value_t is alive.

§get_function_name: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> cef_string_userfree_t>

Returns the function name.

§get_function_handler: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t) -> *mut _cef_v8_handler_t>

Returns the function handler or NULL if not a CEF-created function.

§execute_function: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, object: *mut _cef_v8_value_t, argumentsCount: usize, arguments: *const *mut _cef_v8_value_t) -> *mut _cef_v8_value_t>

Execute the function using the current V8 context. This function should only be called from within the scope of a cef_v8_handler_t or cef_v8_accessor_t callback, or in combination with calling enter() and exit() on a stored cef_v8_context_t reference. |object| is the receiver (‘this’ object) of the function. If |object| is NULL the current context’s global object will be used. |arguments| is the list of arguments that will be passed to the function. Returns the function return value on success. Returns NULL if this function is called incorrectly or an exception is thrown.

§execute_function_with_context: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, context: *mut _cef_v8_context_t, object: *mut _cef_v8_value_t, argumentsCount: usize, arguments: *const *mut _cef_v8_value_t) -> *mut _cef_v8_value_t>

Execute the function using the specified V8 context. |object| is the receiver (‘this’ object) of the function. If |object| is NULL the specified context’s global object will be used. |arguments| is the list of arguments that will be passed to the function. Returns the function return value on success. Returns NULL if this function is called incorrectly or an exception is thrown.

§resolve_promise: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, arg: *mut _cef_v8_value_t) -> c_int>

Resolve the Promise using the current V8 context. This function should only be called from within the scope of a cef_v8_handler_t or cef_v8_accessor_t callback, or in combination with calling enter() and exit() on a stored cef_v8_context_t reference. |arg| is the argument passed to the resolved promise. Returns true (1) on success. Returns false (0) if this function is called incorrectly or an exception is thrown.

§reject_promise: Option<unsafe extern "C" fn(self_: *mut _cef_v8_value_t, errorMsg: *const cef_string_t) -> c_int>

Reject the Promise using the current V8 context. This function should only be called from within the scope of a cef_v8_handler_t or cef_v8_accessor_t callback, or in combination with calling enter() and exit() on a stored cef_v8_context_t reference. Returns true (1) on success. Returns false (0) if this function is called incorrectly or an exception is thrown.

Trait Implementations§

Source§

impl Clone for _cef_v8_value_t

Source§

fn clone(&self) -> _cef_v8_value_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_v8_value_t

Source§

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

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

impl Copy for _cef_v8_value_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.