pub trait Host {
// Required methods
fn call(&self, method: &str, params: Value);
fn navigate(&self, route: &str);
// Provided methods
fn call_then(&self, method: &str, params: Value, fold: &str) { ... }
fn emit(&self, topic: &str, data: Value) -> Result<(), String> { ... }
fn last(&self, topic: &str) -> Value { ... }
fn slots_set(
&self,
layout: &str,
slot: &str,
component: &str,
version: Option<&str>,
) -> Result<(), String> { ... }
}Expand description
What a handler reaches: the engine’s call and navigate.
Required Methods§
Sourcefn call(&self, method: &str, params: Value)
fn call(&self, method: &str, params: Value)
A Plexus call through the engine’s one socket (its answer is not the
handler’s: a live collection hears the change).
Moves the page to route (#/ticket/T-1).
Provided Methods§
Sourcefn call_then(&self, method: &str, params: Value, fold: &str)
fn call_then(&self, method: &str, params: Value, fold: &str)
FRAME-37: call(method, params, "fold") — the call sent once, and
fold run once when its stream ends, with the answer
(crate::bus::Answer) and the call on ev. A host that runs no
fold sends it as Self::call.
Sourcefn emit(&self, topic: &str, data: Value) -> Result<(), String>
fn emit(&self, topic: &str, data: Value) -> Result<(), String>
FRAME-12: data on the bus’s topic; a refusal’s words.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".