pub trait TranscodeState:
Clone
+ Send
+ Sync
+ 'static {
// Required methods
fn grpc_channel(&self) -> Channel;
fn forwarded_headers(&self) -> &[String];
fn sse_keep_alive_secs(&self) -> u64;
}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§
Sourcefn grpc_channel(&self) -> Channel
fn grpc_channel(&self) -> Channel
Lazy gRPC channel to upstream service.
Sourcefn forwarded_headers(&self) -> &[String]
fn forwarded_headers(&self) -> &[String]
Headers to forward from HTTP to gRPC metadata.
Sourcefn sse_keep_alive_secs(&self) -> u64
fn sse_keep_alive_secs(&self) -> u64
SSE keep-alive interval (seconds) for server-streaming responses.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".