pub struct Args<'js> { /* private fields */ }
Expand description
Argument input for a functions
Arguments on the Rust side for calling into the JavaScript context.
Implementations§
Source§impl<'js> Args<'js>
impl<'js> Args<'js>
Sourcepub fn new(ctx: Ctx<'js>, args: usize) -> Args<'js>
pub fn new(ctx: Ctx<'js>, args: usize) -> Args<'js>
Returns a new args with space for a give number of arguments
Sourcepub fn new_unsized(ctx: Ctx<'js>) -> Args<'js>
pub fn new_unsized(ctx: Ctx<'js>) -> Args<'js>
Returns a new args with space for any number of arguments
Sourcepub fn push_args<T, I>(&mut self, iter: I) -> Result<()>where
T: IntoJs<'js>,
I: IntoIterator<Item = T>,
pub fn push_args<T, I>(&mut self, iter: I) -> Result<()>where
T: IntoJs<'js>,
I: IntoIterator<Item = T>,
Add multiple arguments to the list.
Sourcepub fn take_this(&mut self) -> Value<'js>
pub fn take_this(&mut self) -> Value<'js>
Replace the this value with ‘Undefined’ and return the original value.
Sourcepub fn apply<R>(self, func: &Function<'js>) -> Result<R>where
R: FromJs<'js>,
pub fn apply<R>(self, func: &Function<'js>) -> Result<R>where
R: FromJs<'js>,
Call a function with the current set of arguments.
pub fn defer(self, func: Function<'js>) -> Result<()>
pub fn construct<R>(self, constructor: &Constructor<'js>) -> Result<R>where
R: FromJs<'js>,
Trait Implementations§
Auto Trait Implementations§
impl<'js> Freeze for Args<'js>
impl<'js> RefUnwindSafe for Args<'js>
impl<'js> !Send for Args<'js>
impl<'js> !Sync for Args<'js>
impl<'js> Unpin for Args<'js>
impl<'js> !UnwindSafe for Args<'js>
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> 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