pub struct JSEngine {
outstanding_handles: Arc<AtomicU32>,
marker: PhantomData<*mut ()>,
}
Expand description
A handle that must be kept alive in order to create new Runtimes. When this handle is dropped, the engine is shut down and cannot be reinitialized.
Fields§
§outstanding_handles: Arc<AtomicU32>
The count of alive handles derived from this initialized instance.
marker: PhantomData<*mut ()>
Implementations§
source§impl JSEngine
impl JSEngine
sourcepub fn init() -> Result<JSEngine, JSEngineError>
pub fn init() -> Result<JSEngine, JSEngineError>
Initialize the JS engine to prepare for creating new JS runtimes.
pub fn can_shutdown(&self) -> bool
sourcepub fn handle(&self) -> JSEngineHandle
pub fn handle(&self) -> JSEngineHandle
Create a handle to this engine.