pub struct CorePluginResolver { /* private fields */ }Expand description
Wraps a BuiltInRegistry as a PluginResolver.
When the super-global scope queries for a name like "Math",
this resolver checks the registry and materializes a proxy object
whose method calls are dispatched back to the registry.
Implementations§
Source§impl CorePluginResolver
impl CorePluginResolver
pub fn new(registry: BuiltInRegistry) -> Self
pub fn registry(&self) -> &BuiltInRegistry
Trait Implementations§
Source§impl PluginResolver for CorePluginResolver
impl PluginResolver for CorePluginResolver
Source§fn has_binding(&self, name: &str) -> bool
fn has_binding(&self, name: &str) -> bool
Does this resolver provide a binding with the given name? Read more
Source§fn resolve(
&self,
name: &str,
_ctx: &mut EvalContext,
) -> Result<JsValue, JErrorType>
fn resolve( &self, name: &str, _ctx: &mut EvalContext, ) -> Result<JsValue, JErrorType>
Materialize the object for the given name. Read more
Source§fn call_method(
&self,
object_name: &str,
method_name: &str,
ctx: &mut EvalContext,
this: JsValue,
args: Vec<JsValue>,
) -> Option<Result<JsValue, JErrorType>>
fn call_method( &self, object_name: &str, method_name: &str, ctx: &mut EvalContext, this: JsValue, args: Vec<JsValue>, ) -> Option<Result<JsValue, JErrorType>>
Resolve a method on an object this resolver provides. Read more
Source§fn call_constructor(
&self,
object_name: &str,
ctx: &mut EvalContext,
args: Vec<JsValue>,
) -> Option<Result<JsValue, JErrorType>>
fn call_constructor( &self, object_name: &str, ctx: &mut EvalContext, args: Vec<JsValue>, ) -> Option<Result<JsValue, JErrorType>>
Get a constructor for the given object name, if available. Read more
Auto Trait Implementations§
impl Freeze for CorePluginResolver
impl !RefUnwindSafe for CorePluginResolver
impl !Send for CorePluginResolver
impl !Sync for CorePluginResolver
impl Unpin for CorePluginResolver
impl !UnwindSafe for CorePluginResolver
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