pub struct PropertyDescriptor { /* private fields */ }Expand description
This represents a JavaScript Property AKA The Property Descriptor.
Property descriptors present in objects come in three main flavors:
- data descriptors
- accessor descriptors
- generic descriptor
A data Property Descriptor is one that includes any fields named either [[Value]] or [[Writable]].
An accessor Property Descriptor is one that includes any fields named either [[Get]] or [[Set]].
A generic Property Descriptor is a Property Descriptor value that is neither a data Property Descriptor nor an accessor Property Descriptor.
More information:
Implementations§
Source§impl PropertyDescriptor
impl PropertyDescriptor
Sourcepub fn is_accessor_descriptor(&self) -> bool
pub fn is_accessor_descriptor(&self) -> bool
An accessor Property Descriptor is one that includes any fields named either [[Get]] or [[Set]].
More information:
Sourcepub fn is_data_descriptor(&self) -> bool
pub fn is_data_descriptor(&self) -> bool
A data Property Descriptor is one that includes any fields named either [[Value]] or [[Writable]].
More information:
Sourcepub fn is_generic_descriptor(&self) -> bool
pub fn is_generic_descriptor(&self) -> bool
A generic Property Descriptor is one that is neither a data descriptor nor an accessor descriptor.
More information:
pub fn is_empty(&self) -> bool
pub fn enumerable(&self) -> Option<bool>
pub fn configurable(&self) -> Option<bool>
pub fn writable(&self) -> Option<bool>
pub fn value(&self) -> Option<&JsValue>
pub fn get(&self) -> Option<&JsValue>
pub fn set(&self) -> Option<&JsValue>
pub fn expect_enumerable(&self) -> bool
pub fn expect_configurable(&self) -> bool
pub fn expect_writable(&self) -> bool
pub fn expect_value(&self) -> &JsValue
pub fn expect_get(&self) -> &JsValue
pub fn expect_set(&self) -> &JsValue
pub fn kind(&self) -> &DescriptorKind
pub fn builder() -> PropertyDescriptorBuilder
pub fn into_accessor_defaulted(self) -> Self
pub fn into_data_defaulted(self) -> Self
pub fn complete_property_descriptor(self) -> Self
pub fn fill_with(&mut self, desc: Self)
Trait Implementations§
Source§impl Clone for PropertyDescriptor
impl Clone for PropertyDescriptor
Source§fn clone(&self) -> PropertyDescriptor
fn clone(&self) -> PropertyDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more