Struct headers::IfModifiedSince
source · [−]pub struct IfModifiedSince(_);
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
sourceimpl 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
sourceimpl Clone for IfModifiedSince
impl Clone for IfModifiedSince
sourcefn clone(&self) -> IfModifiedSince
fn clone(&self) -> IfModifiedSince
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for IfModifiedSince
impl Debug for IfModifiedSince
sourceimpl From<IfModifiedSince> for SystemTime
impl From<IfModifiedSince> for SystemTime
sourcefn from(date: IfModifiedSince) -> SystemTime
fn from(date: IfModifiedSince) -> SystemTime
Performs the conversion.
sourceimpl From<SystemTime> for IfModifiedSince
impl From<SystemTime> for IfModifiedSince
sourcefn from(time: SystemTime) -> IfModifiedSince
fn from(time: SystemTime) -> IfModifiedSince
Performs the conversion.
sourceimpl Hash for IfModifiedSince
impl Hash for IfModifiedSince
sourceimpl Header for IfModifiedSince
impl Header for IfModifiedSince
sourcefn name() -> &'static HeaderName
fn name() -> &'static HeaderName
The name of this header.
sourceimpl Ord for IfModifiedSince
impl Ord for IfModifiedSince
sourceimpl PartialEq<IfModifiedSince> for IfModifiedSince
impl PartialEq<IfModifiedSince> for IfModifiedSince
sourcefn eq(&self, other: &IfModifiedSince) -> bool
fn eq(&self, other: &IfModifiedSince) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &IfModifiedSince) -> bool
fn ne(&self, other: &IfModifiedSince) -> bool
This method tests for !=
.
sourceimpl PartialOrd<IfModifiedSince> for IfModifiedSince
impl PartialOrd<IfModifiedSince> for IfModifiedSince
sourcefn partial_cmp(&self, other: &IfModifiedSince) -> Option<Ordering>
fn partial_cmp(&self, other: &IfModifiedSince) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Copy for IfModifiedSince
impl Eq for IfModifiedSince
impl StructuralEq for IfModifiedSince
impl StructuralPartialEq for IfModifiedSince
Auto Trait Implementations
impl RefUnwindSafe for IfModifiedSince
impl Send for IfModifiedSince
impl Sync for IfModifiedSince
impl Unpin for IfModifiedSince
impl UnwindSafe for IfModifiedSince
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more