orpc-client
HTTP client for orpc-rs RPC servers.
Overview
Provides a typed Rust client for calling oRPC procedures over HTTP, wire-compatible with @orpc/client. Supports both single-value calls (queries/mutations) and SSE streaming subscriptions.
Key Concepts
Client<L>— Main client struct, generic over aLinktransportLinktrait — Transport abstraction (implement for custom protocols like IPC)RpcLink— Default HTTP transport using reqwest, matching@orpc/clientwire formatClientError— Unified error type covering transport, serialization, and RPC errors
Example
use Client;
// Create a client
let client = new;
// Query / Mutation
let planet: Planet = client.call.await?;
// Subscription (SSE stream)
use StreamExt;
let mut stream = client..await?;
while let Some = stream.next.await
Generated Client
When used with the #[orpc_service] macro, a typed client struct is auto-generated:
// Generated from #[orpc_service(context = AppCtx)] trait PlanetApi { ... }
let client = new;
let planet = client.find_planet.await?;