Skip to main content

RuntimeBridge

Trait RuntimeBridge 

Source
pub trait RuntimeBridge: 'static {
    // Provided methods
    fn install(&mut self, _global: &Value) -> Result<()> { ... }
    fn get(
        &mut self,
        _document: &mut BaseDocument,
        _receiver: &Value,
        _key: &str,
    ) -> Result<Option<Value>> { ... }
    fn set(
        &mut self,
        _document: &mut BaseDocument,
        _receiver: &Value,
        _key: &str,
        _value: Value,
    ) -> Result<bool> { ... }
    fn call(
        &mut self,
        _document: &mut BaseDocument,
        _name: &str,
        _this: Value,
        _arguments: Vec<Value>,
        _construct: bool,
    ) -> Result<Option<Value>> { ... }
    fn poll(
        &mut self,
        _document: &mut BaseDocument,
        _waker: Option<&Waker>,
        _run_timers: bool,
    ) -> Result<Vec<HostJob>> { ... }
    fn has_pending_jobs(&self) -> bool { ... }
    fn pending_task_count(&self) -> u64 { ... }
    fn wait_for_work(&mut self) -> Result<()> { ... }
    fn teardown(&mut self) { ... }
}
Expand description

Embedder-owned resources used by one guest and its live document.

Returning None leaves an operation to the standard guest bindings. The embedder queues callbacks instead of re-entering an already borrowed guest.

Provided Methods§

Source

fn install(&mut self, _global: &Value) -> Result<()>

Source

fn get( &mut self, _document: &mut BaseDocument, _receiver: &Value, _key: &str, ) -> Result<Option<Value>>

Source

fn set( &mut self, _document: &mut BaseDocument, _receiver: &Value, _key: &str, _value: Value, ) -> Result<bool>

Source

fn call( &mut self, _document: &mut BaseDocument, _name: &str, _this: Value, _arguments: Vec<Value>, _construct: bool, ) -> Result<Option<Value>>

Source

fn poll( &mut self, _document: &mut BaseDocument, _waker: Option<&Waker>, _run_timers: bool, ) -> Result<Vec<HostJob>>

Source

fn has_pending_jobs(&self) -> bool

Source

fn pending_task_count(&self) -> u64

Source

fn wait_for_work(&mut self) -> Result<()>

Source

fn teardown(&mut self)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§