Expand description
RPC client (operates uniformly in native and WASM-browser environments).
§TLS crypto provider (native)
Secure (wss://) RPC connections on native targets go through
workflow-websocket → tungstenite → rustls,
which (since 0.23) requires a process-level crypto provider to be installed
before the first connection — typically by the application or a higher-level
SDK at startup:
ⓘ
rustls::crypto::ring::default_provider().install_default().unwrap();If exactly one rustls provider is compiled into the binary, it is selected
automatically and no explicit install is needed; an install is only required
when none — or more than one — provider is present. In the browser/WASM
environment the host WebSocket handles TLS, so no provider is required.
Re-exports§
Modules§
- error
- Client
Errorenum declaration - prelude
- Convenience module exporting all types required for the client use.
- result
- Client
Resultenum encapsulating clientError
Macros§
- notification
- notification!() macro for declaration of RPC notification handlers
Structs§
- Borsh
Protocol - Borsh RPC message handler and dispatcher
- Connect
Options ConnectOptionsis used to configure theWebSocketconnectivity behavior.- Interface
- Collection of server-side notification handlers
- Json
Protocol - Serde JSON RPC message handler and dispatcher
- Notification
- A typed notification handler that deserializes an inbound
Msgpayload (from Borsh or JSON) and invokes the wrapped async callback with it. - Options
- Configuration options used when constructing an
RpcClient. - RpcClient
- wRPC client capable of issuing requests and notifications and dispatching
server-side notifications over a WebSocket connection using either the
Borsh or JSON protocol.
Opsis the application operation enum andIdis the message identifier type. - WebSocket
Config - Configuration struct for WebSocket client (native Tungstenite and NodeJs connections only)
Enums§
- Connect
Strategy ConnectionStrategyspecifies how the WebSocketasync fn connect()function should behave during the first-time connectivity phase. @category WebSocket- Ctl
- Client connection lifecycle event broadcast through the control multiplexer.
Traits§
- Notification
Handler - Handler invoked with the raw payload of an inbound server notification.
- Resolver
- Trait implemented by URL resolvers that supply the destination URL dynamically when no explicit URL has been configured.
Type Aliases§
- Connect
Result - Result of a connect attempt. On success yields
Some(receiver)when the caller did not block on the connection (the receiver fires once connected), orNonewhen the connect call blocked until the connection was established. - Resolver
Result - Result of a
Resolver::resolve_urlcall, yielding the destination URL. - WebSocket
Error - Alias for the WebSocket client
Errortype.