pub struct CallOptions<'a> { /* private fields */ }
👎Deprecating in a future version: use
JsFunction::bind()
insteadExpand description
A builder for making a JavaScript function call like parseInt("42")
.
The builder methods make it convenient to assemble the call from parts:
let x: Handle<JsNumber> = parse_int
.call_with(&cx)
.arg(cx.string("42"))
.apply(&mut cx)?;
Implementations§
Source§impl<'a> CallOptions<'a>
impl<'a> CallOptions<'a>
Sourcepub fn this<V: Value>(&mut self, this: Handle<'a, V>) -> &mut Self
pub fn this<V: Value>(&mut self, this: Handle<'a, V>) -> &mut Self
Set the value of this
for the function call.
Sourcepub fn arg<V: Value>(&mut self, arg: Handle<'a, V>) -> &mut Self
pub fn arg<V: Value>(&mut self, arg: Handle<'a, V>) -> &mut Self
Add an argument to the arguments list.
Sourcepub fn args<A: Arguments<'a>>(&mut self, args: A) -> &mut Self
pub fn args<A: Arguments<'a>>(&mut self, args: A) -> &mut Self
Replaces the arguments list with the given arguments.
Trait Implementations§
Source§impl<'a> Clone for CallOptions<'a>
impl<'a> Clone for CallOptions<'a>
Source§fn clone(&self) -> CallOptions<'a>
fn clone(&self) -> CallOptions<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for CallOptions<'a>
impl<'a> RefUnwindSafe for CallOptions<'a>
impl<'a> !Send for CallOptions<'a>
impl<'a> !Sync for CallOptions<'a>
impl<'a> Unpin for CallOptions<'a>
impl<'a> UnwindSafe for CallOptions<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more