Struct nodex_api::descriptor::DescriptorBuilder
source · [−]pub struct DescriptorBuilder<'a> {
pub utf8name: Option<&'a str>,
pub name: napi_value,
pub method: napi_callback,
pub getter: napi_callback,
pub setter: napi_callback,
pub value: napi_value,
pub attributes: NapiPropertyAttributes,
pub data: *mut c_void,
}
Fields
utf8name: Option<&'a str>
name: napi_value
method: napi_callback
getter: napi_callback
setter: napi_callback
value: napi_value
attributes: NapiPropertyAttributes
data: *mut c_void
Implementations
Optional string describing the key for the property, encoded as UTF8. One of utf8name or name must be provided for the property.
Optional napi_value that points to a JavaScript string or symbol to be used as the key for the property. One of utf8name or name must be provided for the property.
The value that’s retrieved by a get access of the property if the property is a data property. If this is passed in, set getter, setter, method and data to NULL (since these members won’t be used).
Set this to make the property descriptor object’s value property to be a JavaScript function represented by method. If this is passed in, set value, getter and setter to NULL (since these members won’t be used). napi_callback provides more details.
A function to call when a get access of the property is performed. If this is passed in, set value and method to NULL (since these members won’t be used). The given function is called implicitly by the runtime when the property is accessed from JavaScript code (or if a get on the property is performed using a Node-API call). napi_callback provides more details.
A function to call when a set access of the property is performed. If this is passed in, set value and method to NULL (since these members won’t be used). The given function is called implicitly by the runtime when the property is set from JavaScript code (or if a set on the property is performed using a Node-API call). napi_callback provides more details.
The attributes associated with the particular property. See napi_property_attributes.
build finale NapiPropertyDescriptor