pub struct HostName(/* private fields */);Expand description
A validated hostname.
The inner bytes are private and the only public constructor checks them. That is what
stops a caller from putting a CRLF in a host and injecting a header through the
Request-URI: without this, Host::Name(b"evil\r\nInjected: yes") would serialize into a
perfectly convincing forged request line.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HostName
impl RefUnwindSafe for HostName
impl Send for HostName
impl Sync for HostName
impl Unpin for HostName
impl UnsafeUnpin for HostName
impl UnwindSafe for HostName
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