pub trait CallBridge {
// Required methods
fn arora_call(&mut self, call: Call) -> Result<CallResult, CallError>;
fn arora_register_callable(
&mut self,
callable: Rc<dyn Callable>,
) -> CallableId;
fn arora_unregister_callable(&mut self, callable_id: &CallableId);
fn arora_call_indirect(
&mut self,
callable_id: &CallableId,
) -> Result<Value, CallError>;
}Expand description
The interface a module uses to call back into its host (the engine, or a mock in tests). It lives here, in the interface layer, so module-shaped libraries can make host calls without depending on the engine crate.
Required Methods§
Sourcefn arora_call(&mut self, call: Call) -> Result<CallResult, CallError>
fn arora_call(&mut self, call: Call) -> Result<CallResult, CallError>
Dispatch call to the module it names: the call is the full description
of the invocation, and one naming no module is refused.
Sourcefn arora_register_callable(&mut self, callable: Rc<dyn Callable>) -> CallableId
fn arora_register_callable(&mut self, callable: Rc<dyn Callable>) -> CallableId
Registers the given function in the executor and associates it to an
identifier generated on the fly. The function is made available to
every module by calling arora_dispatch_indirect(id: u64) -> Value.
Sourcefn arora_unregister_callable(&mut self, callable_id: &CallableId)
fn arora_unregister_callable(&mut self, callable_id: &CallableId)
Unregisters the function associated to the given identifier.
Sourcefn arora_call_indirect(
&mut self,
callable_id: &CallableId,
) -> Result<Value, CallError>
fn arora_call_indirect( &mut self, callable_id: &CallableId, ) -> Result<Value, CallError>
Calls a callable that was registered.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".