[][src]Struct boa::builtins::property::Property

pub struct Property {
    pub configurable: Option<bool>,
    pub enumerable: Option<bool>,
    pub writable: Option<bool>,
    pub value: Option<Value>,
    pub get: Option<Value>,
    pub set: Option<Value>,
}

A Javascript Property AKA The Property Descriptor
[SPEC] - The Property Descriptor Specification Type
[SPEC] - Default Attribute Values

Any field in a JavaScript Property may be present or absent.

Fields

configurable: Option<bool>

If the type of this can be changed and this can be deleted

enumerable: Option<bool>

If the property shows up in enumeration of the object

writable: Option<bool>

If this property can be changed with an assignment

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 is_property_key(value: &Value) -> bool[src]

Checks if the provided Value can be used as a property key.

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 configurable(self, configurable: bool) -> Self[src]

Set configurable

pub fn enumerable(self, enumerable: bool) -> Self[src]

Set enumerable

pub fn writable(self, writable: bool) -> Self[src]

Set writable

pub fn value(self, value: Value) -> Self[src]

Set value

pub fn get(self, get: Value) -> Self[src]

Set get

pub fn set(self, set: Value) -> Self[src]

Set set

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]].
https://tc39.es/ecma262/#sec-isaccessordescriptor

pub fn is_data_descriptor(&self) -> bool[src]

A data Property Descriptor is one that includes any fields named either [Value] or [[Writable]].
https://tc39.es/ecma262/#sec-isdatadescriptor

pub fn is_generic_descriptor(&self) -> bool[src]

https://tc39.es/ecma262/#sec-isgenericdescriptor

Trait Implementations

impl Clone for Property[src]

impl Debug for Property[src]

impl Default for Property[src]

fn default() -> Self[src]

Make a default property https://tc39.es/ecma262/#table-default-attribute-values

impl Drop for Property[src]

impl Finalize for Property[src]

impl FromValue for Property[src]

fn from_value(v: Value) -> Result<Self, &'static str>[src]

Attempt to fetch values "configurable", "enumerable", "writable" from the value, if they're not there default to false

impl ToValue for Property[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,