[][src]Struct ducc::Function

pub struct Function<'ducc>(_);

Reference to a JavaScript function.

Methods

impl<'ducc> Function<'ducc>[src]

pub fn call<A, R>(&self, args: A) -> Result<R> where
    A: ToValues<'ducc>,
    R: FromValue<'ducc>, 
[src]

Calls the function with the given arguments, with this set to undefined.

pub fn call_method<T, A, R>(&self, this: T, args: A) -> Result<R> where
    T: ToValue<'ducc>,
    A: ToValues<'ducc>,
    R: FromValue<'ducc>, 
[src]

Calls the function with the given this and arguments.

pub fn into_object(self) -> Object<'ducc>[src]

Consumes the function and returns it as a JavaScript object. This is inexpensive, since a function is an object.

Trait Implementations

impl<'ducc> ToValue<'ducc> for Function<'ducc>[src]

impl<'ducc> FromValue<'ducc> for Function<'ducc>[src]

impl<'ducc> Clone for Function<'ducc>[src]

impl<'ducc> Debug for Function<'ducc>[src]

Auto Trait Implementations

impl<'ducc> !Send for Function<'ducc>

impl<'ducc> Unpin for Function<'ducc>

impl<'ducc> !Sync for Function<'ducc>

impl<'ducc> UnwindSafe for Function<'ducc>

impl<'ducc> RefUnwindSafe for Function<'ducc>

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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.

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

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

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