pub struct Params<'a, 'js> { /* private fields */ }
Expand description
A struct which contains the values a callback is called with.
Arguments retrieved from the JavaScript side for calling Rust functions.
Implementations§
Source§impl<'a, 'js> Params<'a, 'js>
impl<'a, 'js> Params<'a, 'js>
Sourcepub fn check_params(&self, num: ParamRequirement) -> Result<()>
pub fn check_params(&self, num: ParamRequirement) -> Result<()>
Checks if the parameters fit the param num requirements.
Sourcepub fn function(&self) -> Value<'js>
pub fn function(&self) -> Value<'js>
Returns the value on which this function called. i.e. in bla.foo()
the foo
value.
Sourcepub fn this(&self) -> Value<'js>
pub fn this(&self) -> Value<'js>
Returns the this on which this function called. i.e. in bla.foo()
the bla
value.
Sourcepub fn is_constructor(&self) -> bool
pub fn is_constructor(&self) -> bool
Returns if the function is called as a constructor.
If it is the value return by this
is actually the new.target
value.
Sourcepub fn access(self) -> ParamsAccessor<'a, 'js>
pub fn access(self) -> ParamsAccessor<'a, 'js>
Turns the params into an accessor object for extracting the arguments.
Auto Trait Implementations§
impl<'a, 'js> Freeze for Params<'a, 'js>
impl<'a, 'js> RefUnwindSafe for Params<'a, 'js>
impl<'a, 'js> !Send for Params<'a, 'js>
impl<'a, 'js> !Sync for Params<'a, 'js>
impl<'a, 'js> Unpin for Params<'a, 'js>
impl<'a, 'js> !UnwindSafe for Params<'a, '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