[][src]Struct qjs::Local

pub struct Local<'a, T> where
    T: Unbindable
{ /* fields omitted */ }

Methods

impl<'a> Local<'a, Value>[src]

pub fn ok(self) -> Result<Local<'a, Value>, Error>[src]

impl<'a> Local<'a, Value>[src]

pub fn call<T: Args>(
    &self,
    this: Option<&Value>,
    args: T
) -> Result<Local<Value>, Error>
[src]

pub fn invoke<N: NewAtom, T: Args>(
    &self,
    atom: N,
    args: T
) -> Result<Local<Value>, Error>
[src]

pub fn call_constructor<T: Args>(&self, args: T) -> Result<Local<Value>, Error>[src]

pub fn call_constructor2<T: Args>(
    &self,
    new_target: Option<&Value>,
    args: T
) -> Result<Local<Value>, Error>
[src]

impl<'a, T> Local<'a, T> where
    T: Unbindable
[src]

pub fn into_inner(self) -> T[src]

pub fn map<U, F>(self, f: F) -> Local<'a, U> where
    F: FnOnce(T) -> U,
    U: Unbindable
[src]

impl<'_> Local<'_, Value>[src]

pub fn write_bytecode(&self) -> Result<Vec<u8>, Error>[src]

impl<'a> Local<'a, Value>[src]

pub fn keys(&self) -> Result<Option<Vec<Atom>>, Error>[src]

Returns an array of a given object's own property names, in the same order as we get with a normal loop.

pub fn get_own_property_names(&self) -> Result<Option<Vec<Atom>>, Error>[src]

Returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object.

pub fn get_own_property_descriptor<T: NewAtom>(
    &self,
    prop: T
) -> Result<Option<Descriptor>, Error>
[src]

Returns a property descriptor for an own property (that is, one directly present on an object and not in the object's prototype chain) of a given object.

pub fn get_property<T: GetProperty>(&self, prop: T) -> Option<Local<Value>>[src]

Get a property value on an object.

pub fn set_property<T: SetProperty, V: NewValue>(
    &self,
    prop: T,
    val: V
) -> Result<bool, Error>
[src]

Set a property value on an object.

pub fn has_property<T: HasProperty>(&self, prop: T) -> Result<bool, Error>[src]

Check if a property on an object.

pub fn delete_property<T: DeleteProperty>(&self, prop: T) -> Result<bool, Error>[src]

Delete a property on an object.

It returns a bool indicating whether or not the property was successfully deleted.

pub fn define_property<T: DefineProperty>(
    &self,
    prop: T,
    val: Option<Value>,
    getter: Option<&Value>,
    setter: Option<&Value>,
    flags: Prop
) -> Result<bool, Error>
[src]

Defines a new property directly on an object, or modifies an existing property on an object.

pub fn define_property_value<T: DefinePropertyValue, V: NewValue>(
    &self,
    prop: T,
    val: V,
    flags: Prop
) -> Result<bool, Error>
[src]

Defines a new property with value directly on an object, or modifies an existing property on an object.

pub fn define_property_get_set<T: DefinePropertyGetSet>(
    &self,
    prop: T,
    getter: Option<&Value>,
    setter: Option<&Value>,
    flags: Prop
) -> Result<bool, Error>
[src]

Defines a new property with getter and setter directly on an object, or modifies an existing property on an object.

pub fn is_extensible(&self) -> Result<bool, Error>[src]

Check if an object is extensible (whether it can have new properties added to it).

pub fn prevent_extensions(&self) -> Result<bool, Error>[src]

Prevents new properties from ever being added to an object (i.e. prevents future extensions to the object).

impl<'_> Local<'_, Value>[src]

pub fn get_opaque<T>(&self, class_id: ClassId) -> *mut T[src]

impl<'a> Local<'a, Value>[src]

pub fn check_undefined(self) -> Option<Local<'a, Value>>[src]

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

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

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

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

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

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

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

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

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

pub fn to_str(&self) -> Local<Value>[src]

pub fn to_property_key(&self) -> Local<Value>[src]

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

pub fn instance_of(&self, obj: &Value) -> Result<bool, Error>[src]

Trait Implementations

impl<'_> GetProperty for Local<'_, JSAtom>[src]

impl<'_> SetProperty for Local<'_, JSAtom>[src]

impl<'_> DefinePropertyValue for Local<'_, JSAtom>[src]

impl<'a> NewValue for Local<'a, Value>[src]

impl<'a> NewValue for &'a Local<'a, Value>[src]

impl<'a, T> Drop for Local<'a, T> where
    T: Unbindable
[src]

impl<'a> Into<Value> for Local<'a, Value>[src]

impl<'a> Into<JSValue> for Local<'a, Value>[src]

impl<'_, T: ExtractValue + PartialOrd> PartialOrd<T> for Local<'_, Value>[src]

#[must_use] fn lt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use] fn le(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use] fn gt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use] fn ge(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'_, T: ExtractValue + PartialEq> PartialEq<T> for Local<'_, Value>[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<'_> Clone for Local<'_, Value>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a, T> DerefMut for Local<'a, T> where
    T: Unbindable
[src]

impl<'a, T> Deref for Local<'a, T> where
    T: Unbindable
[src]

type Target = T

The resulting type after dereferencing.

impl<'_> Display for Local<'_, Value>[src]

impl<'_> Debug for Local<'_, Value>[src]

impl<'_> TryFrom<Local<'_, Value>> for ErrorKind[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'a, T> !Send for Local<'a, T>

impl<'a, T> Unpin for Local<'a, T> where
    T: Unpin

impl<'a, T> !Sync for Local<'a, T>

impl<'a, T> !UnwindSafe for Local<'a, T>

impl<'a, T> !RefUnwindSafe for Local<'a, T>

Blanket Implementations

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> ToString for T where
    T: Display + ?Sized
[src]

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]