#[non_exhaustive]pub enum KeyError {
MissingPeerAddr,
MissingHeader {
name: Box<str>,
},
MalformedForwardedChain,
InvalidValue {
reason: &'static str,
},
}Expand description
A key-extraction failure, handled according to KeyErrorPolicy.
With the default policy the error renders as 400 Bad Request through
ResponseError; the response body never echoes request contents.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
MissingPeerAddr
The request has no peer address (for example a test request without one).
MissingHeader
The configured key header is absent from the request.
MalformedForwardedChain
A trusted forwarding chain contained a malformed hop or exceeded the hop cap.
InvalidValue
A key value was unusable (wrong charset or over the length cap).
Trait Implementations§
impl Eq for KeyError
Source§impl Error for KeyError
impl Error for KeyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl ResponseError for KeyError
impl ResponseError for KeyError
Source§fn status_code(&self) -> StatusCode
fn status_code(&self) -> StatusCode
Returns appropriate status code for error. Read more
Source§fn error_response(&self) -> HttpResponse
fn error_response(&self) -> HttpResponse
Creates full response for error. Read more
impl StructuralPartialEq for KeyError
Auto Trait Implementations§
impl Forget for KeyError
impl Freeze for KeyError
impl Move for KeyError
impl RefUnwindSafe for KeyError
impl Send for KeyError
impl Sync for KeyError
impl Unpin for KeyError
impl UnsafeUnpin for KeyError
impl UnwindSafe for KeyError
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