pub enum Host {
Name(HostName),
Ip(IpAddr),
}Expand description
The host part of a URI.
Variants§
Implementations§
Source§impl Host
impl Host
Sourcepub fn parse_hostport(raw: &Bytes) -> Result<(Self, Option<u16>), UriError>
pub fn parse_hostport(raw: &Bytes) -> Result<(Self, Option<u16>), UriError>
Parse a host [ ":" port ], as it appears in a URI or in a Via sent-by.
Shared with the Via header so that a hostname is validated the same way wherever it
appears; a host that is rejected in a URI must not be accepted in a Via.
Sourcepub fn equivalent(&self, other: &Self) -> bool
pub fn equivalent(&self, other: &Self) -> bool
Whether two hosts are the same.
Hostnames compare case-insensitively. A hostname never matches an IP address, even the one it resolves to — RFC 3261 §19.1.4 is explicit, and a comparison that consulted DNS would be neither pure nor stable.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Host
impl RefUnwindSafe for Host
impl Send for Host
impl Sync for Host
impl Unpin for Host
impl UnsafeUnpin for Host
impl UnwindSafe for Host
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