Skip to main content

ConditionalResponse

Trait ConditionalResponse 

Source
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§

Source

fn with_etag(self, etag: &ETag) -> Self

Set the ETag header on the response.

Source

fn with_last_modified(self, time: SystemTime) -> Self

Set the Last-Modified header on the response.

Source

fn not_modified() -> Self

Create a 304 Not Modified response.

Source

fn not_modified_with_etag(etag: &ETag) -> Self

Create a 304 Not Modified response with an ETag.

Source

fn precondition_failed() -> Self

Create a 412 Precondition Failed response.

Source

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".

Implementors§