pub enum HostApiOutcome {
Response {
data: Vec<u8>,
},
NeedsSign {
request_id: String,
request_tag: u8,
public_key: Vec<u8>,
payload: Vec<u8>,
},
NeedsChainQuery {
request_id: String,
method: String,
params: Value,
},
NeedsChainSubscription {
request_id: String,
method: String,
params: Value,
},
NeedsNavigate {
request_id: String,
url: String,
},
NeedsChainFollow {
request_id: String,
genesis_hash: Vec<u8>,
with_runtime: bool,
},
NeedsChainRpc {
request_id: String,
request_tag: u8,
genesis_hash: Vec<u8>,
json_rpc_method: String,
json_rpc_params: Value,
follow_sub_id: Option<String>,
},
Silent,
}Expand description
Outcome of processing a host-api message.
Variants§
Response
Send this response directly back to the app.
NeedsSign
Sign request — needs wallet to produce a signature before responding.
NeedsChainQuery
JSON-RPC query — needs routing through the chain API allowlist + RPC bridge.
NeedsChainSubscription
JSON-RPC subscription — needs routing through the chain API for streaming responses.
Navigation request — the workbench should open this URL (may be a .dot address).
NeedsChainFollow
Start a chainHead_v1_follow subscription for a specific chain.
NeedsChainRpc
A chain interaction request (header, storage, call, etc.) that needs routing to smoldot via JSON-RPC. The response_tag and json_rpc_method tell the workbench how to route and encode the response.
Fields
Silent
No response needed (fire-and-forget).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HostApiOutcome
impl RefUnwindSafe for HostApiOutcome
impl Send for HostApiOutcome
impl Sync for HostApiOutcome
impl Unpin for HostApiOutcome
impl UnsafeUnpin for HostApiOutcome
impl UnwindSafe for HostApiOutcome
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