pub struct RustFunction<'js>(pub Box<dyn RustFunc<'js> + 'js>);
Expand description
The class used for wrapping closures, rquickjs implements callbacks by creating an instances of this class.
Tuple Fields§
§0: Box<dyn RustFunc<'js> + 'js>
Trait Implementations§
Source§impl<'js> JsClass<'js> for RustFunction<'js>
impl<'js> JsClass<'js> for RustFunction<'js>
Source§fn constructor(_ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
fn constructor(_ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
Returns a predefined constructor for this specific class type if there is one.
Source§impl<'js> JsLifetime<'js> for RustFunction<'js>
impl<'js> JsLifetime<'js> for RustFunction<'js>
Source§type Changed<'to> = RustFunction<'to>
type Changed<'to> = RustFunction<'to>
The target which has the same type as a
Self
but with another lifetime 't
Auto Trait Implementations§
impl<'js> Freeze for RustFunction<'js>
impl<'js> !RefUnwindSafe for RustFunction<'js>
impl<'js> !Send for RustFunction<'js>
impl<'js> !Sync for RustFunction<'js>
impl<'js> Unpin for RustFunction<'js>
impl<'js> !UnwindSafe for RustFunction<'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