pub type JSObjectSetPropertyCallback = Option<unsafe extern "C" fn(ctx: JSContextRef, object: JSObjectRef, propertyName: JSStringRef, value: JSValueRef, exception: *mut JSValueRef) -> bool>;Expand description
The callback invoked when setting a property’s value.
ctx: The execution context to use.object: TheJSObjectRefon which to set the property’s value.propertyName: AJSStringRefcontaining the name of the property to set.value: AJSValueRefto use as the property’s value.exception: A pointer to aJSValueRefin which to return an exception, if any.
Returns true if the property was set, otherwise false.
If you named your function SetProperty, you would declare it like this:
ⓘ
bool
SetProperty(JSContextRef ctx, JSObjectRef object,
JSStringRef propertyName, JSValueRef value,
JSValueRef* exception);If this function returns false, the set request forwards to
object’s statically declared properties, then its parent class
chain (which includes the default object class).
§See also
Aliased Type§
pub enum JSObjectSetPropertyCallback {
None,
Some(unsafe extern "C" fn(*const OpaqueJSContext, *mut OpaqueJSValue, *mut OpaqueJSString, *const OpaqueJSValue, *mut *const OpaqueJSValue) -> bool),
}