Skip to main content

TranscodeState

Trait TranscodeState 

Source
pub trait TranscodeState:
    Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn grpc_channel(&self) -> Channel;
    fn forwarded_headers(&self) -> &[String];
}
Expand description

Trait for state types that support REST→gRPC transcoding.

Implement this for your application’s state type to use transcode::routes(). Provides the minimal interface needed by transcode handlers.

Required Methods§

Source

fn grpc_channel(&self) -> Channel

Lazy gRPC channel to upstream service.

Source

fn forwarded_headers(&self) -> &[String]

Headers to forward from HTTP to gRPC metadata.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§