axum_extra/extract/
rejection.rs

1//! Rejection response types.
2
3use axum_core::{
4    __composite_rejection as composite_rejection, __define_rejection as define_rejection,
5};
6
7define_rejection! {
8    #[status = BAD_REQUEST]
9    #[body = "No host found in request"]
10    /// Rejection type used if the [`Host`](super::Host) extractor is unable to
11    /// resolve a host.
12    pub struct FailedToResolveHost;
13}
14
15composite_rejection! {
16    /// Rejection used for [`Host`](super::Host).
17    ///
18    /// Contains one variant for each way the [`Host`](super::Host) extractor
19    /// can fail.
20    pub enum HostRejection {
21        FailedToResolveHost,
22    }
23}