pub struct UnenteredIsolate { /* private fields */ }Expand description
An isolate that must be accessed via Locker.
Unlike OwnedIsolate, this isolate does not automatically enter itself
upon creation. Instead, you must use a Locker to access it:
ⓘ
let mut isolate = v8::Isolate::new_unentered(Default::default());
// Access the isolate through a Locker
{
let mut locker = v8::Locker::new(&mut isolate);
let scope = &mut v8::HandleScope::new(&mut *locker);
// ... use scope ...
}
// The locker is dropped, isolate can be used from another thread§Thread Safety
UnenteredIsolate implements Send, meaning it can be transferred between
threads. However, V8 isolates are not thread-safe by themselves. You must:
- Only access the isolate through a
Locker - Never have multiple
Lockers for the same isolate simultaneously (V8 will block if you try)
§Dropping
When dropped, the isolate will be properly disposed. The drop will panic
if a Locker is currently held for this isolate.
Implementations§
Trait Implementations§
Source§impl Debug for UnenteredIsolate
impl Debug for UnenteredIsolate
Source§impl Drop for UnenteredIsolate
impl Drop for UnenteredIsolate
impl Send for UnenteredIsolate
Auto Trait Implementations§
impl Freeze for UnenteredIsolate
impl RefUnwindSafe for UnenteredIsolate
impl !Sync for UnenteredIsolate
impl Unpin for UnenteredIsolate
impl UnsafeUnpin for UnenteredIsolate
impl UnwindSafe for UnenteredIsolate
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