rex_v8 0.19.3

V8 isolate pool and SSR engine for the Rex framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::sync::Once;

static V8_INIT: Once = Once::new();

/// Initialize the V8 platform. Safe to call multiple times; only runs once.
pub fn init_v8() {
    V8_INIT.call_once(|| {
        let platform = v8::new_default_platform(0, false).make_shared();
        v8::V8::initialize_platform(platform);
        v8::V8::initialize();
        tracing::debug!("V8 platform initialized");
    });
}