Struct headers::common::if_unmodified_since::IfUnmodifiedSince
source · pub struct IfUnmodifiedSince(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 headers::IfUnmodifiedSince;
use std::time::{SystemTime, Duration};
let time = SystemTime::now() - Duration::from_secs(60 * 60 * 24);
let if_unmod = IfUnmodifiedSince::from(time);
Tuple Fields§
§0: HttpDate
Implementations§
source§impl IfUnmodifiedSince
impl IfUnmodifiedSince
sourcepub fn precondition_passes(&self, last_modified: SystemTime) -> bool
pub fn precondition_passes(&self, last_modified: SystemTime) -> bool
Check if the supplied time passes the precondtion.
Trait Implementations§
source§impl Clone for IfUnmodifiedSince
impl Clone for IfUnmodifiedSince
source§fn clone(&self) -> IfUnmodifiedSince
fn clone(&self) -> IfUnmodifiedSince
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 IfUnmodifiedSince
impl Debug for IfUnmodifiedSince
source§impl From<IfUnmodifiedSince> for SystemTime
impl From<IfUnmodifiedSince> for SystemTime
source§fn from(date: IfUnmodifiedSince) -> SystemTime
fn from(date: IfUnmodifiedSince) -> SystemTime
Converts to this type from the input type.
source§impl From<SystemTime> for IfUnmodifiedSince
impl From<SystemTime> for IfUnmodifiedSince
source§fn from(time: SystemTime) -> IfUnmodifiedSince
fn from(time: SystemTime) -> IfUnmodifiedSince
Converts to this type from the input type.
source§impl Hash for IfUnmodifiedSince
impl Hash for IfUnmodifiedSince
source§impl Header for IfUnmodifiedSince
impl Header for IfUnmodifiedSince
source§impl Ord for IfUnmodifiedSince
impl Ord for IfUnmodifiedSince
source§fn cmp(&self, other: &IfUnmodifiedSince) -> Ordering
fn cmp(&self, other: &IfUnmodifiedSince) -> 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 IfUnmodifiedSince
impl PartialEq for IfUnmodifiedSince
source§fn eq(&self, other: &IfUnmodifiedSince) -> bool
fn eq(&self, other: &IfUnmodifiedSince) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for IfUnmodifiedSince
impl PartialOrd for IfUnmodifiedSince
source§fn partial_cmp(&self, other: &IfUnmodifiedSince) -> Option<Ordering>
fn partial_cmp(&self, other: &IfUnmodifiedSince) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for IfUnmodifiedSince
impl Eq for IfUnmodifiedSince
impl StructuralPartialEq for IfUnmodifiedSince
Auto Trait Implementations§
impl Freeze for IfUnmodifiedSince
impl RefUnwindSafe for IfUnmodifiedSince
impl Send for IfUnmodifiedSince
impl Sync for IfUnmodifiedSince
impl Unpin for IfUnmodifiedSince
impl UnwindSafe for IfUnmodifiedSince
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