[−][src]Struct tide::http::conditional::IfUnmodifiedSince
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]
pub fn new(instant: SystemTime) -> IfUnmodifiedSince
[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<IfUnmodifiedSince>, Error>
[src]
headers: impl AsRef<Headers>
) -> Result<Option<IfUnmodifiedSince>, Error>
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 Debug for IfUnmodifiedSince
[src]
impl Eq for IfUnmodifiedSince
[src]
impl Ord for IfUnmodifiedSince
[src]
pub fn cmp(&self, other: &IfUnmodifiedSince) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<IfUnmodifiedSince> for IfUnmodifiedSince
[src]
pub fn eq(&self, other: &IfUnmodifiedSince) -> bool
[src]
pub fn ne(&self, other: &IfUnmodifiedSince) -> bool
[src]
impl PartialOrd<IfUnmodifiedSince> for IfUnmodifiedSince
[src]
pub fn partial_cmp(&self, other: &IfUnmodifiedSince) -> Option<Ordering>
[src]
pub fn lt(&self, other: &IfUnmodifiedSince) -> bool
[src]
pub fn le(&self, other: &IfUnmodifiedSince) -> bool
[src]
pub fn gt(&self, other: &IfUnmodifiedSince) -> bool
[src]
pub fn ge(&self, other: &IfUnmodifiedSince) -> bool
[src]
impl StructuralEq for IfUnmodifiedSince
[src]
impl StructuralPartialEq for IfUnmodifiedSince
[src]
impl ToHeaderValues for IfUnmodifiedSince
[src]
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
pub fn to_header_values(
&self
) -> Result<<IfUnmodifiedSince as ToHeaderValues>::Iter, Error>
[src]
&self
) -> Result<<IfUnmodifiedSince as ToHeaderValues>::Iter, Error>
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,