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 mco_http
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 mco_http::header::{Headers, Host};
let mut headers = Headers::new();
headers.set(
Host{
hostname: "mco_http.rs".to_owned(),
port: None,
}
);use mco_http::header::{Headers, Host};
let mut headers = Headers::new();
headers.set(
Host{
hostname: "mco_http.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
source§impl PartialEq for Host
impl PartialEq for Host
impl StructuralPartialEq for Host
Auto Trait Implementations§
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