[−][src]Struct http_types::cache::Age
HTTP Age header
Specifications
Examples
use http_types::Response; use http_types::cache::Age; let age = Age::from_secs(12); let mut res = Response::new(200); age.apply(&mut res); let age = Age::from_headers(res)?.unwrap(); assert_eq!(age, Age::from_secs(12));
Implementations
impl Age[src]
pub fn new(dur: Duration) -> Self[src]
Create a new instance of Age.
pub fn from_secs(secs: u64) -> Self[src]
Create a new instance of Age from secs.
pub fn duration(&self) -> Duration[src]
Get the duration from the header.
pub fn from_headers(headers: impl AsRef<Headers>) -> Result<Option<Self>>[src]
Create an instance of Age 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 Age[src]
impl Eq for Age[src]
impl Ord for Age[src]
fn cmp(&self, other: &Age) -> Ordering[src]
#[must_use]fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self[src]
impl PartialEq<Age> for Age[src]
impl PartialOrd<Age> for Age[src]
fn partial_cmp(&self, other: &Age) -> Option<Ordering>[src]
fn lt(&self, other: &Age) -> bool[src]
fn le(&self, other: &Age) -> bool[src]
fn gt(&self, other: &Age) -> bool[src]
fn ge(&self, other: &Age) -> bool[src]
impl StructuralEq for Age[src]
impl StructuralPartialEq for Age[src]
impl ToHeaderValues for Age[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 Age
impl Send for Age
impl Sync for Age
impl Unpin for Age
impl UnwindSafe for Age
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>,