[−][src]Struct tide::http::conditional::IfNoneMatch
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
[src]
pub fn new() -> IfNoneMatch
[src]
Create a new instance of IfNoneMatch
.
pub fn from_headers(
headers: impl AsRef<Headers>
) -> Result<Option<IfNoneMatch>, Error>
[src]
headers: impl AsRef<Headers>
) -> Result<Option<IfNoneMatch>, Error>
Create a new instance from headers.
pub fn apply(&self, headers: impl AsMut<Headers>)
[src]
Sets the If-None-Match
header.
pub fn name(&self) -> HeaderName
[src]
Get the HeaderName
.
pub fn value(&self) -> HeaderValue
[src]
Get the HeaderValue
.
pub fn push(&mut self, directive: impl Into<ETag>)
[src]
Push a directive into the list of entries.
pub fn wildcard(&self) -> bool
[src]
Returns true
if a wildcard directive was set.
pub fn set_wildcard(&mut self, wildcard: bool)
[src]
Set the wildcard directive.
pub fn iter(&self) -> Iter<'_>ⓘ
[src]
An iterator visiting all server entries.
pub fn iter_mut(&mut self) -> IterMut<'_>ⓘ
[src]
An iterator visiting all server entries.
Trait Implementations
impl Debug for IfNoneMatch
[src]
impl<'a> IntoIterator for &'a IfNoneMatch
[src]
type Item = &'a ETag
The type of the elements being iterated over.
type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> <&'a IfNoneMatch as IntoIterator>::IntoIter
[src]
impl IntoIterator for IfNoneMatch
[src]
type Item = ETag
The type of the elements being iterated over.
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> <IfNoneMatch as IntoIterator>::IntoIter
[src]
impl<'a> IntoIterator for &'a mut IfNoneMatch
[src]
type Item = &'a mut ETag
The type of the elements being iterated over.
type IntoIter = IterMut<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> <&'a mut IfNoneMatch as IntoIterator>::IntoIter
[src]
impl ToHeaderValues for IfNoneMatch
[src]
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>
[src]
&self
) -> Result<<IfNoneMatch as ToHeaderValues>::Iter, Error>
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
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,
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<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
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.
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.
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>,