pub enum IfMatch {
Any,
Items(Vec<EntityTag>),
}Expand description
If-Match header, defined
in RFC 7232 §3.1
The If-Match header field makes the request method conditional on
the recipient origin server either having at least one current
representation of the target resource, when the field-value is “*”,
or having a current representation of the target resource that has an
entity-tag matching a member of the list of entity-tags provided in
the field-value.
An origin server MUST use the strong comparison function when
comparing entity-tags for If-Match, since the client
intends this precondition to prevent the method from being applied if
there have been any changes to the representation data.
§Note
This is a request header used for conditional requests (typically to avoid lost updates).
Servers should not send If-Match in responses; use ETag to describe the
current representation instead.
§ABNF
If-Match = "*" / 1#entity-tag§Example Values
"xyzzy"- “xyzzy”, “r2d2xxxx”, “c3piozzzz”
§Examples
use actix_web::{http::header::IfMatch, test};
let req = test::TestRequest::default()
.insert_header(IfMatch::Any)
.to_http_request();use actix_web::{http::header::{EntityTag, IfMatch}, test};
let req = test::TestRequest::default()
.insert_header(IfMatch::Items(vec![
EntityTag::new(false, "xyzzy".to_owned()),
EntityTag::new(false, "foobar".to_owned()),
EntityTag::new(false, "bazquux".to_owned()),
]))
.to_http_request();Variants§
Trait Implementations§
impl Eq for IfMatch
Source§impl Header for IfMatch
impl Header for IfMatch
Source§fn name() -> HeaderName
fn name() -> HeaderName
Source§fn parse<M: HttpMessage>(msg: &M) -> Result<Self, ParseError>
fn parse<M: HttpMessage>(msg: &M) -> Result<Self, ParseError>
impl StructuralPartialEq for IfMatch
Source§impl TryIntoHeaderValue for IfMatch
impl TryIntoHeaderValue for IfMatch
Source§type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
Source§fn try_into_value(self) -> Result<HeaderValue, Self::Error>
fn try_into_value(self) -> Result<HeaderValue, Self::Error>
Auto Trait Implementations§
impl Forget for IfMatch
impl Freeze for IfMatch
impl Move for IfMatch
impl RefUnwindSafe for IfMatch
impl Send for IfMatchwhere
RawVecInner: Send,
impl Sync for IfMatchwhere
RawVecInner: Sync,
impl Unpin for IfMatch
impl UnsafeUnpin for IfMatch
impl UnwindSafe for IfMatchwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.