pub struct DescriptorValueBuilder {
pub utf8name: Option<String>,
pub name: napi_value,
pub value: napi_value,
pub attributes: NapiPropertyAttributes,
}
Expand description
The DescriptorBuild for value.
Fields§
§utf8name: Option<String>
§name: napi_value
§value: napi_value
§attributes: NapiPropertyAttributes
Implementations§
Source§impl DescriptorValueBuilder
impl DescriptorValueBuilder
pub fn new() -> DescriptorValueBuilder
Sourcepub fn with_utf8name(self, name: impl Into<String>) -> Self
pub fn with_utf8name(self, name: impl Into<String>) -> Self
Optional string describing the key for the property, encoded as UTF8. One of utf8name or name must be provided for the property.
Sourcepub fn with_name(self, name: impl NapiValueT) -> Self
pub fn with_name(self, name: impl NapiValueT) -> Self
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.
Sourcepub fn with_value(self, value: impl NapiValueT) -> Self
pub fn with_value(self, value: impl NapiValueT) -> Self
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).
Sourcepub fn with_attribute(self, attribute: NapiPropertyAttributes) -> Self
pub fn with_attribute(self, attribute: NapiPropertyAttributes) -> Self
The attributes associated with the particular property. See napi_property_attributes.
Sourcepub fn build(self) -> NapiResult<NapiPropertyDescriptor>
pub fn build(self) -> NapiResult<NapiPropertyDescriptor>
build finale NapiPropertyDescriptor
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DescriptorValueBuilder
impl RefUnwindSafe for DescriptorValueBuilder
impl !Send for DescriptorValueBuilder
impl !Sync for DescriptorValueBuilder
impl Unpin for DescriptorValueBuilder
impl UnwindSafe for DescriptorValueBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more