Struct actix_web::http::header::LastModified [−][src]
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 std::time::{SystemTime, Duration}; use actix_web::HttpResponse; use actix_web::http::header::LastModified; let mut builder = HttpResponse::Ok(); let modified = SystemTime::now() - Duration::from_secs(60 * 60 * 24); builder.insert_header( LastModified(modified.into()) );
Trait Implementations
Returns the name of the header field
Parse a header
type Error = InvalidHeaderValue
type Error = InvalidHeaderValueThe type returned in the event of a conversion error.
Try to convert value to a HeaderValue.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for LastModifiedimpl Send for LastModifiedimpl Sync for LastModifiedimpl Unpin for LastModifiedimpl UnwindSafe for LastModifiedBlanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Error = <T as IntoHeaderValue>::Errorpub fn try_into_header_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as IntoHeaderPair>::Error>type Output = T
type Output = TShould always be Self
pub fn vzip(self) -> V