pub struct MeshExtension { /* private fields */ }Implementations§
Source§impl MeshExtension
impl MeshExtension
pub fn new() -> Self
pub fn with_runtime<R>(runtime: R) -> Selfwhere
R: MeshRuntime,
Trait Implementations§
Source§impl Default for MeshExtension
impl Default for MeshExtension
Source§impl HostExtension for MeshExtension
impl HostExtension for MeshExtension
Source§fn namespace(&self) -> &str
fn namespace(&self) -> &str
Sub-namespace under
window.host.ext.* (e.g. “data” → window.host.ext.data)Source§fn inject_script(&self) -> &str
fn inject_script(&self) -> &str
JavaScript injected after HOST_API_SCRIPT. Must: Read more
Source§fn handle_message(&self, method: &str, params: &str) -> Option<String>
fn handle_message(&self, method: &str, params: &str) -> Option<String>
Handle a message from the JS bridge.
method is the method name from the JS _call.
params is the JSON params object as a string.
Returns a serialized JSON result, or None for fire-and-forget.Source§fn drain_events(&self) -> Vec<HostPushEvent>
fn drain_events(&self) -> Vec<HostPushEvent>
Drain queued push events destined for
window.host.on(...) listeners. Read moreAuto Trait Implementations§
impl Freeze for MeshExtension
impl !RefUnwindSafe for MeshExtension
impl Send for MeshExtension
impl Sync for MeshExtension
impl Unpin for MeshExtension
impl UnsafeUnpin for MeshExtension
impl !UnwindSafe for MeshExtension
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