pub struct Host {
pub hostname: String,
pub port: Option<u16>,
}
Expand description
The Host
header.
HTTP/1.1 requires that all requests include a Host
header, and so hyper
client requests add one automatically.
Currently is just a String, but it should probably become a better type,
like url::Host
or something.
§Examples
use hyper::header::{Headers, Host};
let mut headers = Headers::new();
headers.set(
Host{
hostname: "hyper.rs".to_owned(),
port: None,
}
);
use hyper::header::{Headers, Host};
let mut headers = Headers::new();
headers.set(
Host{
hostname: "hyper.rs".to_owned(),
port: Some(8080),
}
);
Fields§
§hostname: String
The hostname, such a example.domain.
port: Option<u16>
An optional port number.
Trait Implementations§
source§impl HeaderFormat for Host
impl HeaderFormat 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
)