[−][src]Struct boa::property::Property
This represents a Javascript Property AKA The Property Descriptor.
Property descriptors present in objects come in two main flavors:
- data descriptors
- accessor descriptors
A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter pair of functions. A descriptor must be one of these two flavors; it cannot be both.
Any field in a JavaScript Property may be present or absent.
More information:
Fields
value: Option<Value>The value associated with the property
get: Option<Value>The function serving as getter
set: Option<Value>The function serving as setter
Implementations
impl Property[src]
pub fn new() -> Self[src]
Make a new property with the given value The difference between New and Default:
New: zeros everything to make an empty object Default: Defaults according to the spec
pub fn empty() -> Self[src]
pub fn data_descriptor(value: Value, attribute: Attribute) -> Self[src]
pub fn configurable(&self) -> bool[src]
Get the
pub fn set_configurable(&mut self, configurable: bool)[src]
pub fn configurable_or(&self, value: bool) -> bool[src]
pub fn enumerable(&self) -> bool[src]
Set enumerable
pub fn enumerable_or(&self, value: bool) -> bool[src]
pub fn writable(&self) -> bool[src]
Set writable
pub fn writable_or(&self, value: bool) -> bool[src]
pub fn value(self, value: Value) -> Self[src]
Set value
pub fn get(self, get: Value) -> Self[src]
Set get
pub fn has_get(&self) -> bool[src]
pub fn set(self, set: Value) -> Self[src]
Set set
pub fn has_set(&self) -> bool[src]
pub fn is_none(&self) -> bool[src]
Is this an empty Property?
true if all fields are set to none
pub fn is_accessor_descriptor(&self) -> bool[src]
An accessor Property Descriptor is one that includes any fields named either [[Get]] or [[Set]].
More information:
pub fn is_data_descriptor(&self) -> bool[src]
A data Property Descriptor is one that includes any fields named either [Value] or [[Writable]].
More information:
pub fn is_generic_descriptor(&self) -> bool[src]
Trait Implementations
impl Clone for Property[src]
impl Debug for Property[src]
impl Default for Property[src]
impl Drop for Property[src]
impl Finalize for Property[src]
impl<'_> From<&'_ Property> for Value[src]
impl<'a> From<&'a Value> for Property[src]
fn from(value: &Value) -> Self[src]
Attempt to fetch values "configurable", "enumerable", "writable" from the value, if they're not there default to false
impl Trace for Property[src]
Auto Trait Implementations
impl !RefUnwindSafe for Property
impl !Send for Property
impl !Sync for Property
impl Unpin for Property
impl !UnwindSafe for Property
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> NativeObject for T where
T: Any + Debug + Trace, [src]
T: Any + Debug + Trace,
fn as_any(&Self) -> &(dyn Any + 'static)[src]
fn as_mut_any(&mut Self) -> &mut (dyn Any + 'static)[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,