pub trait TranscodeState:
Clone
+ Send
+ Sync
+ 'static {
type Upstream: Upstream;
// Required methods
fn into_upstream(self) -> Self::Upstream;
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. Each request
works on its own clone of the state, so a clone should be cheap.
Required Associated Types§
Required Methods§
Sourcefn into_upstream(self) -> Self::Upstream
fn into_upstream(self) -> Self::Upstream
The upstream, taken out of this request’s clone of the state.
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".