pub struct Lock<'cx, C> { /* private fields */ }
Expand description
A temporary lock of an execution context.
While a lock is alive, no JavaScript code can be executed in the execution context.
Values that support the Borrow
trait may be dynamically borrowed by passing a
Lock
.
Implementations§
Source§impl<'a: 'cx, 'cx, C> Lock<'cx, C>where
C: Context<'a>,
impl<'a: 'cx, 'cx, C> Lock<'cx, C>where
C: Context<'a>,
Sourcepub fn new(cx: &'cx mut C) -> Lock<'cx, C>
pub fn new(cx: &'cx mut C) -> Lock<'cx, C>
Constructs a new Lock
and locks the VM. See also Context::lock
.
Trait Implementations§
Auto Trait Implementations§
impl<'cx, C> !Freeze for Lock<'cx, C>
impl<'cx, C> !RefUnwindSafe for Lock<'cx, C>
impl<'cx, C> !Send for Lock<'cx, C>
impl<'cx, C> !Sync for Lock<'cx, C>
impl<'cx, C> Unpin for Lock<'cx, C>
impl<'cx, C> UnwindSafe for Lock<'cx, C>where
C: RefUnwindSafe,
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