Struct http_types::other::Expect [−][src]
pub struct Expect { /* fields omitted */ }HTTP Expect header
Specifications
Examples
use http_types::Response; use http_types::other::Expect; let expect = Expect::new(); let mut res = Response::new(200); expect.apply(&mut res); let expect = Expect::from_headers(res)?.unwrap(); assert_eq!(expect, Expect::new());
Implementations
impl Expect[src]
impl Expect[src]pub fn new() -> Self[src]
Create a new instance of Expect.
pub fn from_headers(headers: impl AsRef<Headers>) -> Result<Option<Self>>[src]
Create an instance of Expect from a Headers instance.
pub fn apply(&self, headers: impl AsMut<Headers>)[src]
Insert a HeaderName + HeaderValue pair into a Headers instance.
pub fn name(&self) -> HeaderName[src]
Get the HeaderName.
pub fn value(&self) -> HeaderValue[src]
Get the HeaderValue.
Trait Implementations
impl PartialOrd<Expect> for Expect[src]
impl PartialOrd<Expect> for Expect[src]impl StructuralEq for Expect[src]
impl StructuralEq for Expect[src]impl StructuralPartialEq for Expect[src]
impl StructuralPartialEq for Expect[src]impl ToHeaderValues for Expect[src]
impl ToHeaderValues for Expect[src]type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
fn to_header_values(&self) -> Result<Self::Iter>[src]
Auto Trait Implementations
impl RefUnwindSafe for Expect
impl RefUnwindSafe for Expectimpl UnwindSafe for Expect
impl UnwindSafe for Expect