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_valuemethod: napi_callbackgetter: napi_callbacksetter: napi_callbackvalue: napi_valueattributes: NapiPropertyAttributesdata: *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

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.