[][src]Struct boa::builtins::object::Object

pub struct Object {
    pub data: ObjectData,
    // some fields omitted
}

The internal representation of an JavaScript object.

Fields

data: ObjectData

The type of the object.

Implementations

impl Object[src]

pub fn has_property(&self, val: &Value) -> bool[src]

Check if object has property.

More information:

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

Check if it is extensible.

More information:

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

Disable extensibility.

More information:

pub fn delete(&mut self, prop_key: &Value) -> bool[src]

Delete property.

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

pub fn set(&mut self, field: Value, val: Value) -> bool[src]

pub fn define_own_property(
    &mut self,
    property_key: String,
    desc: Property
) -> bool
[src]

Define an own property.

More information:

pub fn get_own_property(&self, prop: &Value) -> Property[src]

The specification returns a Property Descriptor or Undefined.

These are 2 separate types and we can't do that here.

More information:

pub fn set_prototype_of(&mut self, val: Value) -> bool[src]

Object.setPropertyOf(obj, prototype)

This method sets the prototype (i.e., the internal [[Prototype]] property) of a specified object to another object or null.

More information:

pub fn get_prototype_of(&self) -> Value[src]

Returns either the prototype or null

More information:

pub fn get_internal_slot(&self, name: &str) -> Value[src]

Helper function to get an immutable internal slot or Null.

pub fn set_internal_slot(&mut self, name: &str, val: Value)[src]

Helper function to set an internal slot.

pub fn get_field(&self, name: &str) -> Option<&Value>[src]

This function returns an Optional reference value to the objects field.

if it exist Some is returned with a reference to that fields value. Otherwise None is retuned.

impl Object[src]

pub fn new() -> Self[src]

pub fn function(function: Function) -> Self[src]

Return a new ObjectData struct, with kind set to Ordinary

pub fn create(proto: Value) -> Self[src]

ObjectCreate is used to specify the runtime creation of new ordinary objects.

More information:

pub fn boolean(value: bool) -> Self[src]

Return a new Boolean object whose [[BooleanData]] internal slot is set to argument.

pub fn number(value: f64) -> Self[src]

Return a new Number object whose [[NumberData]] internal slot is set to argument.

pub fn string<S>(value: S) -> Self where
    S: Into<RcString>, 
[src]

Return a new String object whose [[StringData]] internal slot is set to argument.

pub fn bigint(value: RcBigInt) -> Self[src]

Return a new BigInt object whose [[BigIntData]] internal slot is set to argument.

pub fn from(value: &Value) -> Result<Self, ()>[src]

Converts the Value to an Object type.

More information:

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

It determines if Object is a callable function with a [[Call]] internal method.

More information:

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

It determines if Object is a function object with a [[Construct]] internal method.

More information:

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

Checks if it an Array object.

pub fn as_array(&self) -> Option<()>[src]

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

Checks if it a String object.

pub fn as_string(&self) -> Option<RcString>[src]

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

Checks if it a Function object.

pub fn as_function(&self) -> Option<&Function>[src]

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

Checks if it a Symbol object.

pub fn as_symbol(&self) -> Option<RcSymbol>[src]

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

Checks if it an Error object.

pub fn as_error(&self) -> Option<()>[src]

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

Checks if it a Boolean object.

pub fn as_boolean(&self) -> Option<bool>[src]

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

Checks if it a Number object.

pub fn as_number(&self) -> Option<f64>[src]

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

Checks if it a BigInt object.

pub fn as_bigint(&self) -> Option<&BigInt>[src]

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

Checks if it an ordinary object.

pub fn internal_slots(&self) -> &FxHashMap<String, Value>[src]

pub fn internal_slots_mut(&mut self) -> &mut FxHashMap<String, Value>[src]

pub fn properties(&self) -> &FxHashMap<RcString, Property>[src]

pub fn properties_mut(&mut self) -> &mut FxHashMap<RcString, Property>[src]

pub fn symbol_properties(&self) -> &FxHashMap<u32, Property>[src]

pub fn symbol_properties_mut(&mut self) -> &mut FxHashMap<u32, Property>[src]

pub fn state(&self) -> &Option<InternalStateCell>[src]

pub fn state_mut(&mut self) -> &mut Option<InternalStateCell>[src]

Trait Implementations

impl Clone for Object[src]

impl Debug for Object[src]

impl Default for Object[src]

fn default() -> Self[src]

Return a new ObjectData struct, with kind set to Ordinary

impl Drop for Object[src]

impl Finalize for Object[src]

impl From<Object> for Value[src]

impl Trace for Object[src]

Auto Trait Implementations

impl !RefUnwindSafe for Object

impl !Send for Object

impl !Sync for Object

impl Unpin for Object

impl !UnwindSafe for Object

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>,