Struct ajars_surf::surf::http::conditional::IfNoneMatch
[−]pub struct IfNoneMatch { /* private fields */ }
Expand description
Apply the HTTP method if the ETags do not match.
This is used to update caches or to prevent uploading a new resource when one already exists.
Specifications
Examples
use http_types::Response;
use http_types::conditional::{IfNoneMatch, ETag};
let mut entries = IfNoneMatch::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 = IfNoneMatch::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 IfNoneMatch
impl IfNoneMatch
pub fn new() -> IfNoneMatch
pub fn new() -> IfNoneMatch
Create a new instance of IfNoneMatch
.
pub fn from_headers(
headers: impl AsRef<Headers>
) -> Result<Option<IfNoneMatch>, Error>
pub fn from_headers(
headers: impl AsRef<Headers>
) -> Result<Option<IfNoneMatch>, 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 Debug for IfNoneMatch
impl Debug for IfNoneMatch
impl<'a> IntoIterator for &'a IfNoneMatch
impl<'a> IntoIterator for &'a IfNoneMatch
fn into_iter(self) -> <&'a IfNoneMatch as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a IfNoneMatch as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
impl<'a> IntoIterator for &'a mut IfNoneMatch
impl<'a> IntoIterator for &'a mut IfNoneMatch
fn into_iter(self) -> <&'a mut IfNoneMatch as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a mut IfNoneMatch as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
impl IntoIterator for IfNoneMatch
impl IntoIterator for IfNoneMatch
fn into_iter(self) -> <IfNoneMatch as IntoIterator>::IntoIter
fn into_iter(self) -> <IfNoneMatch as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
impl ToHeaderValues for IfNoneMatch
impl ToHeaderValues for IfNoneMatch
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<<IfNoneMatch as ToHeaderValues>::Iter, Error>
fn to_header_values(
&self
) -> Result<<IfNoneMatch as ToHeaderValues>::Iter, Error>
Converts this object to an iterator of resolved HeaderValues
.
Auto Trait Implementations
impl RefUnwindSafe for IfNoneMatch
impl Send for IfNoneMatch
impl Sync for IfNoneMatch
impl Unpin for IfNoneMatch
impl UnwindSafe for IfNoneMatch
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