mesh_rpc/lib.rs
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! gRPC-style client and server implementation.
5//!
6//! This provides [gRPC](https://grpc.io/) and
7//! [ttrpc](https://github.com/containerd/ttrpc) servers and clients that
8//! interop well with mesh channels, allowing gRPC to be easily used with a
9//! mesh-based application.
10//!
11//! Currently, the server supports the gRPC and ttrpc protocols, while the
12//! client only supports the ttrpc protocol.
13//!
14//! # Usage
15//!
16//! 1. Define your service in a `.proto` file.
17//! 2. Use `mesh_build::MeshServiceGenerator` in your `build.rs` to generate
18//! Rust traits and types for the service.
19//! 3. Implement the generated service trait.
20//! 4. Create a [`Server`] and register your service implementation.
21//!
22//! See `mesh_rpc/examples/rust-server.rs` for a working example.
23
24#![forbid(unsafe_code)]
25
26#[cfg(test)]
27extern crate self as mesh_rpc;
28
29pub mod client;
30mod message;
31mod rpc;
32pub mod server;
33pub mod service;
34
35pub use client::Client;
36pub use server::Server;