pub struct IfModifiedSince(/* private fields */);
Expand description
If-Modified-Since
header, defined in
RFC7232
The If-Modified-Since
header field makes a GET or HEAD request
method conditional on the selected representation’s modification date
being more recent than the date provided in the field-value.
Transfer of the selected representation’s data is avoided if that
data has not changed.
§ABNF
If-Modified-Since = HTTP-date
§Example values
Sat, 29 Oct 1994 19:43:31 GMT
§Example
use headers::IfModifiedSince;
use std::time::{Duration, SystemTime};
let time = SystemTime::now() - Duration::from_secs(60 * 60 * 24);
let if_mod = IfModifiedSince::from(time);
Implementations§
Source§impl IfModifiedSince
impl IfModifiedSince
Sourcepub fn is_modified(&self, last_modified: SystemTime) -> bool
pub fn is_modified(&self, last_modified: SystemTime) -> bool
Check if the supplied time means the resource has been modified.
Trait Implementations§
Source§impl Clone for IfModifiedSince
impl Clone for IfModifiedSince
Source§fn clone(&self) -> IfModifiedSince
fn clone(&self) -> IfModifiedSince
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for IfModifiedSince
impl Debug for IfModifiedSince
Source§impl From<SystemTime> for IfModifiedSince
impl From<SystemTime> for IfModifiedSince
Source§fn from(time: SystemTime) -> IfModifiedSince
fn from(time: SystemTime) -> IfModifiedSince
Converts to this type from the input type.
Source§impl Hash for IfModifiedSince
impl Hash for IfModifiedSince
Source§impl Header for IfModifiedSince
impl Header for IfModifiedSince
Source§fn name() -> &'static HeaderName
fn name() -> &'static HeaderName
The name of this header.
Source§fn decode<'i, I>(values: &mut I) -> Result<IfModifiedSince, Error>where
I: Iterator<Item = &'i HeaderValue>,
fn decode<'i, I>(values: &mut I) -> Result<IfModifiedSince, Error>where
I: Iterator<Item = &'i HeaderValue>,
Decode this type from an iterator of
HeaderValue
s.Source§impl Ord for IfModifiedSince
impl Ord for IfModifiedSince
Source§fn cmp(&self, other: &IfModifiedSince) -> Ordering
fn cmp(&self, other: &IfModifiedSince) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for IfModifiedSince
impl PartialEq for IfModifiedSince
Source§impl PartialOrd for IfModifiedSince
impl PartialOrd for IfModifiedSince
impl Copy for IfModifiedSince
impl Eq for IfModifiedSince
impl StructuralPartialEq for IfModifiedSince
Auto Trait Implementations§
impl Freeze for IfModifiedSince
impl RefUnwindSafe for IfModifiedSince
impl Send for IfModifiedSince
impl Sync for IfModifiedSince
impl Unpin for IfModifiedSince
impl UnwindSafe for IfModifiedSince
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key
and return true
if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<H> HeaderExt for Hwhere
H: Header + Sealed,
impl<H> HeaderExt for Hwhere
H: Header + Sealed,
Source§fn encode_to_value(&self) -> HeaderValue
fn encode_to_value(&self) -> HeaderValue
Encode this
Header
to HeaderValue
.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more