pub struct Host { /* private fields */ }
Expand description
The Host
header.
HTTP/1.1 requires that all requests include a Host
header, and so hyper
client requests add one automatically.
§Examples
use hyper::header::{Headers, Host};
let mut headers = Headers::new();
headers.set(
Host::new("hyper.rs", None)
);
use hyper::header::{Headers, Host};
let mut headers = Headers::new();
headers.set(
// In Rust 1.12+
// Host::new("hyper.rs", 8080)
Host::new("hyper.rs", Some(8080))
);
Implementations§
Trait Implementations§
Source§impl Header for Host
impl Header for Host
impl StructuralPartialEq for Host
Auto Trait Implementations§
impl Freeze for Host
impl RefUnwindSafe for Host
impl Send for Host
impl Sync for Host
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)