pub struct TranscodeOptions { /* private fields */ }Expand description
How routes_with_options builds the transcoded routes.
§Examples
use structured_proxy::transcode::error::ErrorDetailsPolicy;
use structured_proxy::transcode::TranscodeOptions;
let options = TranscodeOptions::default()
.with_error_details(ErrorDetailsPolicy::default().route("/v1/admin/**", false).unwrap())
.with_ndjson_envelope(true);Implementations§
Source§impl TranscodeOptions
impl TranscodeOptions
Sourcepub fn with_error_details(self, policy: ErrorDetailsPolicy) -> Self
pub fn with_error_details(self, policy: ErrorDetailsPolicy) -> Self
Which routes return google.rpc.Status details in their error bodies
(all of them by default).
Sourcepub fn with_ndjson_envelope(self, enabled: bool) -> Self
pub fn with_ndjson_envelope(self, enabled: bool) -> Self
Wrap every NDJSON line of a server-streaming response in an envelope:
{"result": <message>} for data, {"error": <error body>} for the
terminal error (the grpc-gateway stream shape). Off by default, when a
data line is the bare message and the error line carries an
@type: google.rpc.Status marker instead. Only the envelope keeps the
two apart for RPCs that stream google.protobuf.Any, Struct, Value
or ListValue, whose messages can carry any keys. SSE is unaffected.
Trait Implementations§
Source§impl Clone for TranscodeOptions
impl Clone for TranscodeOptions
Source§impl Debug for TranscodeOptions
impl Debug for TranscodeOptions
Auto Trait Implementations§
impl Freeze for TranscodeOptions
impl RefUnwindSafe for TranscodeOptions
impl Send for TranscodeOptions
impl Sync for TranscodeOptions
impl Unpin for TranscodeOptions
impl UnsafeUnpin for TranscodeOptions
impl UnwindSafe for TranscodeOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request