Skip to main content

Crate sova_grpc

Crate sova_grpc 

Source
Expand description

Connect-JSON unary RPC for Sova — client first, optional server.

use sova_grpc::{FakeGrpc, Grpc, GrpcExt};
use serde::{Deserialize, Serialize};

#[derive(Serialize)]
struct HelloIn { name: String }
#[derive(Deserialize)]
struct HelloOut { message: String }

let fake = FakeGrpc::new().stub_json("hello.Greeter/SayHello", serde_json::json!({
    "message": "hi"
}));
app.install(Grpc::fake(fake));

let out: HelloOut = req.grpc().call("hello.Greeter/SayHello", &HelloIn { name: "a".into() }).await?;

Structs§

FakeGrpc
Grpc
Connect-JSON unary RPC. Prefer Grpc::client / Grpc::fake.
GrpcBound
GrpcCall
GrpcClient
Shared client in app state.
GrpcServerBuilder
MethodRouter

Enums§

GrpcError

Traits§

GrpcExt
GrpcTransport