Trait routing::Cache [] [src]

pub trait Cache: Send {
    fn get(&self, request: &Request) -> Option<Response>;
    fn put(&self, response: Response);
}

A cache that stores Responses keyed by Requests. Should be implemented by layers above routing.

Required Methods

fn get(&self, request: &Request) -> Option<Response>

Retrieve cached response for the given request.

fn put(&self, response: Response)

Cache the given response.

Implementors