Crate grpc

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:

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-grpc services.

Macros§

include_file_descriptor_set
Include an encoded prost_types::FileDescriptorSet as a &'static [u8]. The parameter must be the stem of the filename passed to file_descriptor_set_path for the rama-grpc-build::Builder, excluding the .bin extension.
include_proto
Include generated proto server and client items.

Structs§

ConnectError
Wrapper type to indicate that an error occurs during the connection process, so that the appropriate gRPC Status can be inferred.
GrpcMethod
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.
TimeoutExpired
Error returned if a request didn’t complete within the configured timeout.

Enums§

Code
gRPC status codes used by Status.

Traits§

IntoRequest
Trait implemented by RPC request types.
IntoStreamingRequest
Trait implemented by RPC streaming request types.

Type Aliases§

Result
Result is a type that represents either success (Ok) or failure (Err). By default, the Err value is of type Status but this can be overridden if desired.