pub enum Error {
AbsentHeader {
header_name: HeaderName,
},
NonAsciiHeaderValue {
header_name: HeaderName,
},
MalformedHeaderValue {
header_name: HeaderName,
header_value: String,
},
SingleHeaderRequired {
header_name: HeaderName,
},
ForwardedNoFor {
header_value: String,
},
ForwardedObfuscated {
header_value: String,
},
ForwardedUnknown {
header_value: String,
},
}
Expand description
Errors that can occur during IP extraction
Variants§
AbsentHeader
The IP-related header is missing
Fields
§
header_name: HeaderName
Header name
NonAsciiHeaderValue
Header value contains not only visible ASCII characters
Fields
§
header_name: HeaderName
Header name
MalformedHeaderValue
Header value has an unexpected format
SingleHeaderRequired
Multiple occurrences of a header required to occur only once found
According to the HTTP/1.1 specification (RFC 7230, Section 3.2.2):
A sender MUST NOT generate multiple header fields with the same field name in a message unless either the entire field value for that header field is defined as a comma-separated list …
Fields
§
header_name: HeaderName
Header name
ForwardedNoFor
Available on crate feature
forwarded-header
only.Forwarded header doesn’t contain for
directive
ForwardedObfuscated
Available on crate feature
forwarded-header
only.RFC 7239 allows to obfuscate IPs
ForwardedUnknown
Available on crate feature
forwarded-header
only.RFC 7239 allows unknown identifiers
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl !Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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