Struct ureq::Header [−][src]
pub struct Header { /* fields omitted */ }
Wrapper type for a header line.
Methods
impl Header
[src]
impl Header
pub fn new(name: &str, value: &str) -> Self
[src]
pub fn new(name: &str, value: &str) -> Self
pub fn name(&self) -> &str
[src]
pub fn name(&self) -> &str
The header name.
let header = "X-Forwarded-For: 127.0.0.1" .parse::<ureq::Header>() .unwrap(); assert_eq!("X-Forwarded-For", header.name());
pub fn value(&self) -> &str
[src]
pub fn value(&self) -> &str
The header value.
let header = "X-Forwarded-For: 127.0.0.1" .parse::<ureq::Header>() .unwrap(); assert_eq!("127.0.0.1", header.value());
pub fn is_name(&self, other: &str) -> bool
[src]
pub fn is_name(&self, other: &str) -> bool
Compares the given str to the header name ignoring case.
let header = "X-Forwarded-For: 127.0.0.1" .parse::<ureq::Header>() .unwrap(); assert!(header.is_name("x-forwarded-for"));
Trait Implementations
impl Clone for Header
[src]
impl Clone for Header
fn clone(&self) -> Header
[src]
fn clone(&self) -> Header
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for Header
[src]
impl Debug for Header
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl FromStr for Header
[src]
impl FromStr for Header