pub struct Function<'ducc>(/* private fields */);Expand description
Reference to a JavaScript function.
Implementations§
Source§impl<'ducc> Function<'ducc>
impl<'ducc> Function<'ducc>
Sourcepub fn call<A, R>(&self, args: A) -> Result<R>
pub fn call<A, R>(&self, args: A) -> Result<R>
Calls the function with the given arguments, with this set to undefined.
Sourcepub fn call_method<T, A, R>(&self, this: T, args: A) -> Result<R>
pub fn call_method<T, A, R>(&self, this: T, args: A) -> Result<R>
Calls the function with the given this and arguments.
Sourcepub fn into_object(self) -> Object<'ducc>
pub fn into_object(self) -> Object<'ducc>
Consumes the function and returns it as a JavaScript object. This is inexpensive, since a function is an object.
Trait Implementations§
Auto Trait Implementations§
impl<'ducc> Freeze for Function<'ducc>
impl<'ducc> RefUnwindSafe for Function<'ducc>
impl<'ducc> !Send for Function<'ducc>
impl<'ducc> !Sync for Function<'ducc>
impl<'ducc> Unpin for Function<'ducc>
impl<'ducc> UnsafeUnpin for Function<'ducc>
impl<'ducc> UnwindSafe for Function<'ducc>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more