Struct http_types::cache::Age [−][src]
pub struct Age { /* fields omitted */ }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]
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 PartialOrd<Age> for Age[src]
impl PartialOrd<Age> for Age[src]impl StructuralEq for Age[src]
impl StructuralEq for Age[src]impl StructuralPartialEq for Age[src]
impl StructuralPartialEq for Age[src]impl ToHeaderValues 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 RefUnwindSafe for Ageimpl UnwindSafe for Age
impl UnwindSafe for Age