Crate grpc
Expand description
§rama-grpc
gRPC modules and support for Rama.
This crate provides a Rust implementation of gRPC, an RPC framework built
on HTTP/2. rama-grpc is a fork of
tonic, adapted to integrate with
the Rama ecosystem.
§Examples
Examples can be found under examples within the rama repository.
§Structure
§Generic implementation
The main goal of rama-grpc is to provide a generic gRPC implementation over HTTP/2
framing. This means at the lowest level this library provides the ability to use
a generic HTTP/2 implementation with different types of gRPC encodings formats. Generally,
some form of codegen should be used instead of interacting directly with the items in
client and server.
§Transport
There are no transport layers in rama-grpc. Use rama’s http/tls/unix/udp capabilities for that.
§gRPC-web
You can find gRPC-web support in the web module.
§Code generated client/server configuration
§Max Message Size
Currently, both servers and clients can be configured to set the max message encoding and
decoding size. This will ensure that an incoming gRPC message will not exhaust the systems
memory. By default, the decoding message limit is 4MB and the encoding limit is usize::MAX.
§Rama
Crate used by the end-user rama crate and rama crate authors alike.
Learn more about rama:
- Github: https://github.com/plabayo/rama
- Book: https://ramaproxy.org/book/
Modules§
- build
- Grpc codgen support for rama
- client
- Generic client implementation.
- codec
- Generic encoding and decoding.
- metadata
- Contains data structures and utilities for handling gRPC custom metadata.
- protobuf
- protocol buffer (protobuf) support for
rama-grpc - server
- Generic server implementation.
- service
- Utilities for using rama services with rama-grpc.
- web
- grpc-web protocol translation for
rama-grpcservices.
Macros§
- include_
file_ descriptor_ set - Include an encoded
prost_types::FileDescriptorSetas a&'static [u8]. The parameter must be the stem of the filename passed tofile_descriptor_set_pathfor therama-grpc-build::Builder, excluding the.binextension. - include_
proto - Include generated proto server and client items.
Structs§
- Connect
Error - Wrapper type to indicate that an error occurs during the connection process, so that the appropriate gRPC Status can be inferred.
- Grpc
Method - A gRPC Method info extension.
- Request
- A gRPC request and metadata from an RPC call.
- Response
- A gRPC response and metadata from an RPC call.
- Status
- A gRPC status describing the result of an RPC call.
- Streaming
- Streaming requests and responses.
- Timeout
Expired - Error returned if a request didn’t complete within the configured timeout.
Enums§
Traits§
- Into
Request - Trait implemented by RPC request types.
- Into
Streaming Request - Trait implemented by RPC streaming request types.