Struct nodex_api::descriptor::DescriptorValueBuilder
source · [−]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
sourceimpl 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 RefUnwindSafe for DescriptorValueBuilder
impl !Send for DescriptorValueBuilder
impl !Sync for DescriptorValueBuilder
impl Unpin for DescriptorValueBuilder
impl UnwindSafe for DescriptorValueBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more