pub trait CheckResponseExt: Sealed {
// Required methods
fn new() -> Self;
fn with_status(status: Status) -> Self;
fn set_status(&mut self, status: Status) -> &mut Self;
fn set_dynamic_metadata(
&mut self,
dynamic_metadata: Option<Struct>,
) -> &mut Self;
fn set_http_response(
&mut self,
http_response: impl ToHttpResponse,
) -> &mut Self;
}Expand description
Extension trait aiming to provide convenient associated fn’s and methods
to create and edit pb::CheckResponse.
This trait is sealed and not meant to be implemented outside of
envoy-types.
Required Methods§
Sourcefn new() -> Self
fn new() -> Self
Create a new, empty pb::CheckResponse.
Please note that if you return an empty pb::CheckResponse, the
request will be denied, since there will not be an inner Ok
rpc::Status.
Sourcefn with_status(status: Status) -> Self
fn with_status(status: Status) -> Self
Create a new pb::CheckResponse with the rpc::Status’s
code and message matching those of the tonic::Status provided.
Please note that tonic::Status’s details will not be considered.
Sourcefn set_status(&mut self, status: Status) -> &mut Self
fn set_status(&mut self, status: Status) -> &mut Self
Set the pb::CheckResponse inner rpc::Status’s code and
message as those of the tonic::Status provided.
Please note that tonic::Status’s details will not be considered.
Sourcefn set_dynamic_metadata(
&mut self,
dynamic_metadata: Option<Struct>,
) -> &mut Self
fn set_dynamic_metadata( &mut self, dynamic_metadata: Option<Struct>, ) -> &mut Self
Set the pb::CheckResponse’s dynamic_metadata field.
Sourcefn set_http_response(&mut self, http_response: impl ToHttpResponse) -> &mut Self
fn set_http_response(&mut self, http_response: impl ToHttpResponse) -> &mut Self
Set the pb::CheckResponse’s http_response field.
Compatible with OkHttpResponseBuilder,
DeniedHttpResponseBuilder, or even pb::OkHttpResponse,
pb::DeniedHttpResponse and pb::HttpResponse.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.