Skip to main content

Module transcode

Module transcode 

Source
Expand description

JSON <-> protobuf transcoding for the +json codec.

grpc-webnext carries opaque message bytes; the envelope (frames, trailers) is always protobuf, but the application message may be JSON. Converting JSON to the binary protobuf that a gRPC handler expects (and back) needs the message descriptors, so a Transcoder is built from a compiled FileDescriptorSet (e.g. protoc --descriptor_set_out / prost_build ... file_descriptor_set_path).

Re-exports§

pub use crate::httprule::HttpCall;
pub use crate::httprule::WsBinding;

Structs§

Transcoder
Transcodes application messages between JSON and binary protobuf, keyed by gRPC method path (/pkg.Service/Method), and maps google.api.http REST bindings onto gRPC methods.

Enums§

TranscodeError