[][src]Struct duk::Reference

pub struct Reference<'a> { /* fields omitted */ }

A reference to a value that lives within a Context.

Methods

impl<'a> Reference<'a>[src]

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

Converts this reference to a Value which can be used for further processing by Rust code.

pub fn get(&self, name: &str) -> Result<Reference<'a>>[src]

Gets the property with the specified key, provided that this reference points to something that is object coercible.

pub fn call(&self, args: &[&dyn Argument]) -> Result<Reference<'a>>[src]

Calls the function that this reference points to without a this binding, using the specified arguments.

When the function executes, the this binding is set to undefined or the global object, depending on if the function is strict or not. Calling this function is equivalent to doing myfunc.call(undefined, args) in Javascript.

pub fn call_with_this(
    &self,
    this: &dyn Argument,
    args: &[&dyn Argument]
) -> Result<Reference<'a>>
[src]

Calls the function that this reference points to with an explicit this binding.

pub fn call_method(
    &self,
    name: &str,
    args: &[&dyn Argument]
) -> Result<Reference<'a>>
[src]

Calls a method on the object that this reference points to.

The this binding will be set to the object during the execution of the function. Calling this function is equivalent to doing myobj[name](args...) in Javascript.

pub fn new(&self, args: &[&dyn Argument]) -> Result<Reference<'a>>[src]

Calls the function that this reference points to as a constructor, with the specified arguments.

Trait Implementations

impl<'a> Argument for Reference<'a>[src]

impl<'a> Debug for Reference<'a>[src]

impl<'a> Drop for Reference<'a>[src]

impl<'a> PartialEq<Reference<'a>> for Reference<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Reference<'a>

impl<'a> !Send for Reference<'a>

impl<'a> !Sync for Reference<'a>

impl<'a> Unpin for Reference<'a>

impl<'a> !UnwindSafe for Reference<'a>

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