pub struct LastModified(pub HttpDate);
Expand description
Last-Modified
header, defined in
RFC7232
The Last-Modified
header field in a response provides a timestamp
indicating the date and time at which the origin server believes the
selected representation was last modified, as determined at the
conclusion of handling the request.
ABNF
Expires = HTTP-date
Example values
Sat, 29 Oct 1994 19:43:31 GMT
Example
use actix_web::HttpResponse;
use actix_web::http::header::LastModified;
use std::time::{SystemTime, Duration};
let mut builder = HttpResponse::Ok();
let modified = SystemTime::now() - Duration::from_secs(60 * 60 * 24);
builder.set(LastModified(modified.into()));
Tuple Fields§
§0: HttpDate
Trait Implementations§
source§impl Clone for LastModified
impl Clone for LastModified
source§fn clone(&self) -> LastModified
fn clone(&self) -> LastModified
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LastModified
impl Debug for LastModified
source§impl Deref for LastModified
impl Deref for LastModified
source§impl DerefMut for LastModified
impl DerefMut for LastModified
source§impl Display for LastModified
impl Display for LastModified
source§impl PartialEq<LastModified> for LastModified
impl PartialEq<LastModified> for LastModified
source§fn eq(&self, other: &LastModified) -> bool
fn eq(&self, other: &LastModified) -> bool
impl StructuralPartialEq for LastModified
Auto Trait Implementations§
impl RefUnwindSafe for LastModified
impl Send for LastModified
impl Sync for LastModified
impl Unpin for LastModified
impl UnwindSafe for LastModified
Blanket Implementations§
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self
to an expression for Diesel’s query builder. Read more