pub trait RefusalResponse<B>: Sealed<B> {
// Required method
fn refusal_response(&self, cx: RejectContext<'_>) -> Response<B>;
}Available on crate feature
tower only.Expand description
Builds the response for a refusal (its body and any extra headers); see
HttpAuthLayerBuilder::on_reject. Implemented for EmptyRefusal (the
default) and for every Fn(RejectContext<'_>) -> http::Response<B>.
Sealed: it can be named in bounds, but not implemented outside this crate,
since only HttpAuthLayerBuilder::on_reject (which takes a closure) can
install a refusal builder.
Required Methods§
Sourcefn refusal_response(&self, cx: RejectContext<'_>) -> Response<B>
fn refusal_response(&self, cx: RejectContext<'_>) -> Response<B>
The response for this refusal, before the layer sets its status and
WWW-Authenticate challenge.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".