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 cogo_http::header::{Headers, Host};
let mut headers = Headers::new();
headers.set(
Host{
hostname: "hyper.rs".to_owned(),
port: None,
}
);use cogo_http::header::{Headers, Host};
let mut headers = Headers::new();
headers.set(
Host{
hostname: "hyper.rs".to_owned(),
port: Some(8080),
}
);Fields§
§hostname: StringThe 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