HostCreateShadowRealmContextCallback

Type Alias HostCreateShadowRealmContextCallback 

Source
pub type HostCreateShadowRealmContextCallback = for<'s, 'i> fn(scope: &mut PinScope<'s, 'i>) -> Option<Local<'s, Context>>;
Expand description

HostCreateShadowRealmContextCallback is called each time a ShadowRealm is being constructed. You can use [HandleScope::get_current_context] to get the Context in which the constructor is being run.

The method combines Context creation and the implementation-defined abstract operation HostInitializeShadowRealm into one.

The embedder should use Context::new to create a new context. If the creation fails, the embedder must propagate that exception by returning None.