[−][src]Struct tide::http::other::Expect
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]
pub fn new() -> Expect
[src]
Create a new instance of Expect
.
pub fn from_headers(
headers: impl AsRef<Headers>
) -> Result<Option<Expect>, Error>
[src]
headers: impl AsRef<Headers>
) -> Result<Option<Expect>, Error>
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 Debug for Expect
[src]
impl Eq for Expect
[src]
impl Ord for Expect
[src]
pub fn cmp(&self, other: &Expect) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Expect> for Expect
[src]
impl PartialOrd<Expect> for Expect
[src]
pub fn partial_cmp(&self, other: &Expect) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Expect) -> bool
[src]
pub fn le(&self, other: &Expect) -> bool
[src]
pub fn gt(&self, other: &Expect) -> bool
[src]
pub fn ge(&self, other: &Expect) -> bool
[src]
impl StructuralEq for Expect
[src]
impl StructuralPartialEq for Expect
[src]
impl ToHeaderValues for Expect
[src]
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
pub fn to_header_values(
&self
) -> Result<<Expect as ToHeaderValues>::Iter, Error>
[src]
&self
) -> Result<<Expect as ToHeaderValues>::Iter, Error>
Auto Trait Implementations
impl RefUnwindSafe for Expect
[src]
impl Send for Expect
[src]
impl Sync for Expect
[src]
impl Unpin for Expect
[src]
impl UnwindSafe for Expect
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,