Struct ajars_actix_web::actix_web::http::header::IfUnmodifiedSince [−][src]
pub struct IfUnmodifiedSince(pub HttpDate);
Expand description
If-Unmodified-Since
header, defined in
RFC7232
The If-Unmodified-Since
header field makes the request method
conditional on the selected representation’s last modification date
being earlier than or equal to the date provided in the field-value.
This field accomplishes the same purpose as If-Match for cases where
the user agent does not have an entity-tag for the representation.
ABNF
If-Unmodified-Since = HTTP-date
Example values
Sat, 29 Oct 1994 19:43:31 GMT
Example
use std::time::{SystemTime, Duration};
use actix_web::HttpResponse;
use actix_web::http::header::IfUnmodifiedSince;
let mut builder = HttpResponse::Ok();
let modified = SystemTime::now() - Duration::from_secs(60 * 60 * 24);
builder.insert_header(
IfUnmodifiedSince(modified.into())
);
Tuple Fields
0: HttpDate
Trait Implementations
Returns the name of the header field
Parse a header
type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
The type returned in the event of a conversion error.
pub fn try_into_value(
self
) -> Result<HeaderValue, <IfUnmodifiedSince as IntoHeaderValue>::Error>
pub fn try_into_value(
self
) -> Result<HeaderValue, <IfUnmodifiedSince as IntoHeaderValue>::Error>
Try to convert value to a HeaderValue.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for IfUnmodifiedSince
impl Send for IfUnmodifiedSince
impl Sync for IfUnmodifiedSince
impl Unpin for IfUnmodifiedSince
impl UnwindSafe for IfUnmodifiedSince
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
impl<T> IntoHeaderPair for T where
T: Header,
impl<T> IntoHeaderPair for T where
T: Header,
type Error = <T as IntoHeaderValue>::Error
pub fn try_into_header_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as IntoHeaderPair>::Error>
type Output = T
type Output = T
Should always be Self