Struct ajars_surf::surf::http::conditional::IfMatch
[−]pub struct IfMatch { /* private fields */ }
Expand description
Apply the HTTP method if the ETag matches.
Specifications
Examples
use http_types::Response;
use http_types::conditional::{IfMatch, ETag};
let mut entries = IfMatch::new();
entries.push(ETag::new("0xcafebeef".to_string()));
entries.push(ETag::new("0xbeefcafe".to_string()));
let mut res = Response::new(200);
entries.apply(&mut res);
let entries = IfMatch::from_headers(res)?.unwrap();
let mut entries = entries.iter();
assert_eq!(entries.next().unwrap(), &ETag::new("0xcafebeef".to_string()));
assert_eq!(entries.next().unwrap(), &ETag::new("0xbeefcafe".to_string()));
Implementations
impl IfMatch
impl IfMatch
pub fn from_headers(
headers: impl AsRef<Headers>
) -> Result<Option<IfMatch>, Error>
pub fn from_headers(
headers: impl AsRef<Headers>
) -> Result<Option<IfMatch>, Error>
Create a new instance from headers.
pub fn name(&self) -> HeaderName
pub fn name(&self) -> HeaderName
Get the HeaderName
.
pub fn value(&self) -> HeaderValue
pub fn value(&self) -> HeaderValue
Get the HeaderValue
.
pub fn set_wildcard(&mut self, wildcard: bool)
pub fn set_wildcard(&mut self, wildcard: bool)
Set the wildcard directive.
Trait Implementations
impl<'a> IntoIterator for &'a mut IfMatch
impl<'a> IntoIterator for &'a mut IfMatch
impl IntoIterator for IfMatch
impl IntoIterator for IfMatch
impl<'a> IntoIterator for &'a IfMatch
impl<'a> IntoIterator for &'a IfMatch
impl ToHeaderValues for IfMatch
impl ToHeaderValues for IfMatch
type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
fn to_header_values(&self) -> Result<<IfMatch as ToHeaderValues>::Iter, Error>
fn to_header_values(&self) -> Result<<IfMatch as ToHeaderValues>::Iter, Error>
Converts this object to an iterator of resolved HeaderValues
.
Auto Trait Implementations
impl RefUnwindSafe for IfMatch
impl Send for IfMatch
impl Sync for IfMatch
impl Unpin for IfMatch
impl UnwindSafe for IfMatch
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more