pub enum ClientIpHeader {
XForwardedFor,
XRealIp,
}Expand description
The forwarding header a trusted proxy reports the client IP in.
Only this header is read: falling back to another one would let a client write the header the proxy does not set.
§Examples
use ironflow_api::rate_limit::ClientIpHeader;
assert_eq!(ClientIpHeader::default(), ClientIpHeader::XForwardedFor);
assert_eq!("X-Real-IP".parse::<ClientIpHeader>()?, ClientIpHeader::XRealIp);Variants§
XForwardedFor
X-Forwarded-For, read from the right, trusted hops skipped.
XRealIp
X-Real-IP, a single address set by the proxy.
Trait Implementations§
Source§impl Clone for ClientIpHeader
impl Clone for ClientIpHeader
impl Copy for ClientIpHeader
Source§impl Debug for ClientIpHeader
impl Debug for ClientIpHeader
Source§impl Default for ClientIpHeader
impl Default for ClientIpHeader
impl Eq for ClientIpHeader
Source§impl FromStr for ClientIpHeader
impl FromStr for ClientIpHeader
Source§impl PartialEq for ClientIpHeader
impl PartialEq for ClientIpHeader
impl StructuralPartialEq for ClientIpHeader
Auto Trait Implementations§
impl Freeze for ClientIpHeader
impl RefUnwindSafe for ClientIpHeader
impl Send for ClientIpHeader
impl Sync for ClientIpHeader
impl Unpin for ClientIpHeader
impl UnsafeUnpin for ClientIpHeader
impl UnwindSafe for ClientIpHeader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.