pub struct Handler {
cache: Arc<Cache<String, String>>,
}
Expand description
Hello handler with a cache.
Fields§
§cache: Arc<Cache<String, String>>
Implementations§
Source§impl Handler
impl Handler
const OK: &'static str = "<!DOCTYPE html> <html lang=\"en\"> <head> <meta charset=\"utf-8\"> <title>Hello!</title> </head> <body> <p>Result for key \"{key}\" is \"{result}\"</p> </body> </html>"
const NOT_FOUND: &'static str = "<!DOCTYPE html> <html lang=\"en\"> <head> <meta charset=\"utf-8\"> <title>Hello!</title> </head> <body> <h1>Oops!</h1> <p>Sorry, I don't know what you're asking for.</p> </body> </html>"
Sourcepub fn handle_conn(&self, request_id: usize, stream: TcpStream) -> Report
pub fn handle_conn(&self, request_id: usize, stream: TcpStream) -> Report
Process the request and generate report.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Handler
impl RefUnwindSafe for Handler
impl Send for Handler
impl Sync for Handler
impl Unpin for Handler
impl UnwindSafe for Handler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more