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<D>(req: &Request<D>) -> bool

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

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

Trait Implementations

impl<D> Middleware<D> for FaviconHandler

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