Struct http_types::conditional::IfMatch [−][src]
pub struct IfMatch { /* fields omitted */ }
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
[src]
impl IfMatch
[src]pub fn new() -> Self
[src]
Create a new instance of IfMatch
.
pub fn from_headers(headers: impl AsRef<Headers>) -> Result<Option<Self>>
[src]
Create a new instance from headers.
pub fn apply(&self, headers: impl AsMut<Headers>)
[src]
Sets the If-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 IntoIterator for IfMatch
[src]
impl IntoIterator for IfMatch
[src]impl<'a> IntoIterator for &'a IfMatch
[src]
impl<'a> IntoIterator for &'a IfMatch
[src]impl<'a> IntoIterator for &'a mut IfMatch
[src]
impl<'a> IntoIterator for &'a mut IfMatch
[src]impl ToHeaderValues for IfMatch
[src]
impl ToHeaderValues for IfMatch
[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 IfMatch
impl RefUnwindSafe for IfMatch
impl UnwindSafe for IfMatch
impl UnwindSafe for IfMatch