pub trait ConditionalResponse {
// Required methods
fn with_etag(self, etag: &ETag) -> Self;
fn with_last_modified(self, time: SystemTime) -> Self;
fn not_modified() -> Self;
fn not_modified_with_etag(etag: &ETag) -> Self;
fn precondition_failed() -> Self;
fn precondition_failed_with_message(message: &str) -> Self;
}Expand description
Extension trait for conditional response handling on HttpResponse.
Required Methods§
Sourcefn with_last_modified(self, time: SystemTime) -> Self
fn with_last_modified(self, time: SystemTime) -> Self
Set the Last-Modified header on the response.
Sourcefn not_modified() -> Self
fn not_modified() -> Self
Create a 304 Not Modified response.
Sourcefn not_modified_with_etag(etag: &ETag) -> Self
fn not_modified_with_etag(etag: &ETag) -> Self
Create a 304 Not Modified response with an ETag.
Sourcefn precondition_failed() -> Self
fn precondition_failed() -> Self
Create a 412 Precondition Failed response.
Sourcefn precondition_failed_with_message(message: &str) -> Self
fn precondition_failed_with_message(message: &str) -> Self
Create a 412 Precondition Failed response with a message.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".