Struct http_types::conditional::IfUnmodifiedSince [−][src]
pub struct IfUnmodifiedSince { /* fields omitted */ }
Apply the HTTP method if the entity has not been modified after the given date.
Specifications
Examples
use http_types::Response; use http_types::conditional::IfUnmodifiedSince; use std::time::{SystemTime, Duration}; let time = SystemTime::now() + Duration::from_secs(5 * 60); let expires = IfUnmodifiedSince::new(time); let mut res = Response::new(200); expires.apply(&mut res); let expires = IfUnmodifiedSince::from_headers(res)?.unwrap(); // HTTP dates only have second-precision. let elapsed = time.duration_since(expires.modified())?; assert_eq!(elapsed.as_secs(), 0);
Implementations
impl IfUnmodifiedSince
[src]
impl IfUnmodifiedSince
[src]pub fn new(instant: SystemTime) -> Self
[src]
Create a new instance of IfUnmodifiedSince
.
pub fn modified(&self) -> SystemTime
[src]
Returns the last modification time listed.
pub fn from_headers(headers: impl AsRef<Headers>) -> Result<Option<Self>>
[src]
Create an instance of IfUnmodifiedSince
from a Headers
instance.
pub fn apply(&self, headers: impl AsMut<Headers>)
[src]
Insert a HeaderName
+ HeaderValue
pair into a Headers
instance.
pub fn name(&self) -> HeaderName
[src]
Get the HeaderName
.
pub fn value(&self) -> HeaderValue
[src]
Get the HeaderValue
.
Trait Implementations
impl Eq for IfUnmodifiedSince
[src]
impl Eq for IfUnmodifiedSince
[src]impl Ord for IfUnmodifiedSince
[src]
impl Ord for IfUnmodifiedSince
[src]impl PartialEq<IfUnmodifiedSince> for IfUnmodifiedSince
[src]
impl PartialEq<IfUnmodifiedSince> for IfUnmodifiedSince
[src]fn eq(&self, other: &IfUnmodifiedSince) -> bool
[src]
fn ne(&self, other: &IfUnmodifiedSince) -> bool
[src]
impl PartialOrd<IfUnmodifiedSince> for IfUnmodifiedSince
[src]
impl PartialOrd<IfUnmodifiedSince> for IfUnmodifiedSince
[src]fn partial_cmp(&self, other: &IfUnmodifiedSince) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl StructuralEq for IfUnmodifiedSince
[src]
impl StructuralEq for IfUnmodifiedSince
[src]impl ToHeaderValues for IfUnmodifiedSince
[src]
impl ToHeaderValues for IfUnmodifiedSince
[src]type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
fn to_header_values(&self) -> Result<Self::Iter>
[src]
Auto Trait Implementations
impl RefUnwindSafe for IfUnmodifiedSince
impl RefUnwindSafe for IfUnmodifiedSince
impl Send for IfUnmodifiedSince
impl Send for IfUnmodifiedSince
impl Sync for IfUnmodifiedSince
impl Sync for IfUnmodifiedSince
impl Unpin for IfUnmodifiedSince
impl Unpin for IfUnmodifiedSince
impl UnwindSafe for IfUnmodifiedSince
impl UnwindSafe for IfUnmodifiedSince