armature-grpc

Crates.ioarmature-grpc
lib.rsarmature-grpc
version0.1.0
created_at2025-12-26 22:55:12.322794+00
updated_at2025-12-26 22:55:12.322794+00
descriptiongRPC server and client support for Armature
homepagehttps://pegasusheavy.github.io/armature
repositoryhttps://github.com/pegasusheavy/armature
max_upload_size
id2006377
size81,661
Joseph R. Quinn (quinnjr)

documentation

README

armature-grpc

gRPC server and client support for the Armature framework.

Features

  • Tonic Integration - Built on the Tonic gRPC library
  • Code Generation - Protobuf compilation support
  • Streaming - Unary, server, client, and bidirectional streaming
  • Interceptors - Request/response middleware
  • TLS - Secure connections with rustls

Installation

[dependencies]
armature-grpc = "0.1"

Quick Start

Server

use armature_grpc::{GrpcServer, Request, Response, Status};

pub struct MyService;

#[tonic::async_trait]
impl Greeter for MyService {
    async fn say_hello(
        &self,
        request: Request<HelloRequest>,
    ) -> Result<Response<HelloReply>, Status> {
        let reply = HelloReply {
            message: format!("Hello {}!", request.into_inner().name),
        };
        Ok(Response::new(reply))
    }
}

#[tokio::main]
async fn main() {
    GrpcServer::builder()
        .add_service(GreeterServer::new(MyService))
        .serve("0.0.0.0:50051")
        .await
        .unwrap();
}

Client

use armature_grpc::GrpcClient;

let client = GreeterClient::connect("http://localhost:50051").await?;
let response = client.say_hello(HelloRequest { name: "World".into() }).await?;
println!("Response: {}", response.into_inner().message);

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt