Struct nickel::FaviconHandler [] [src]

pub struct FaviconHandler {
    // some fields omitted
}

Methods

impl FaviconHandler

fn new<P: AsRef<Path>>(icon_path: P) -> FaviconHandler

Create a new middleware to serve an /favicon.ico file from an in-memory cache. The file is only read from disk once when the server starts.

Examples

use nickel::{Nickel, FaviconHandler};
let mut server = Nickel::new();

server.utilize(FaviconHandler::new("/path/to/ico/file"));

fn is_favicon_request(req: &Request) -> bool

fn handle_request<'a>(&self, req: &Request, res: Response<'a>) -> MiddlewareResult<'a>

fn send_favicon<'a, 'b>(&self, req: &Request, res: Response<'a>) -> MiddlewareResult<'a>

Trait Implementations

impl Middleware for FaviconHandler

fn invoke<'a, 'b>(&'a self, req: &mut Request<'b, 'a, 'b>, res: Response<'a, Fresh>) -> MiddlewareResult<'a>