Struct rquickjs_core::This
source · [−]#[repr(transparent)]pub struct This<T>(pub T);
Expand description
The wrapper to get this
from input
// Get the `this` value via arguments
let func = Function::new(ctx, |this: This<i32>, factor: i32| {
this.into_inner() * factor
})?;
// Pass the `this` value to a function
assert_eq!(func.call::<_, i32>((This(3), 2))?, 6);
Tuple Fields
0: T
Implementations
sourceimpl<T> This<T>
impl<T> This<T>
pub fn into_inner(self) -> T
Trait Implementations
impl<T: Copy> Copy for This<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for This<T> where
T: RefUnwindSafe,
impl<T> Send for This<T> where
T: Send,
impl<T> Sync for This<T> where
T: Sync,
impl<T> Unpin for This<T> where
T: Unpin,
impl<T> UnwindSafe for This<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more