pub struct Resolved {
pub address: ClientAddress,
pub other_present: bool,
}Expand description
client_address and whether the other header kind was present too.
§Examples
use core::net::IpAddr;
use parse_net::{forwarded::client_address_detailed, ClientAddress, ForwardedSource};
let peer: IpAddr = "10.0.0.1".parse()?;
let xff: [&[u8]; 1] = [b"198.51.100.7"];
let r = client_address_detailed(peer, ForwardedSource::XForwardedFor(&xff), &[], &|a: IpAddr| a == peer, 16)?;
assert_eq!(r.address, ClientAddress::Forwarded { addr: "198.51.100.7".parse()?, hops: 1 });
assert!(!r.other_present);Fields§
§address: ClientAddressThe client address.
other_present: boolWhether the header kind not configured had a non-empty line: worth logging as a likely spoofing attempt (the two are never merged).
Trait Implementations§
impl Copy for Resolved
impl Eq for Resolved
impl StructuralPartialEq for Resolved
Auto Trait Implementations§
impl Freeze for Resolved
impl RefUnwindSafe for Resolved
impl Send for Resolved
impl Sync for Resolved
impl Unpin for Resolved
impl UnsafeUnpin for Resolved
impl UnwindSafe for Resolved
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