[][src]Trait tide_naive_static_files::StaticRootDir

pub trait StaticRootDir {
    fn root_dir(&self) -> &Path;
}

A trait that provides a way to get a &Path to your static assets directory from your tide app's state. Meant to be used with the serve_static_files function.

use std::path::Path;
use tide_naive_static_files::StaticRootDir;

struct MyState;

impl StaticRootDir for MyState {
    fn root_dir(&self) -> &Path {
        Path::new("./my-static-assets-dir")
    }
}

Required methods

fn root_dir(&self) -> &Path

Loading content...

Implementations on Foreign Types

impl<'_, T: StaticRootDir> StaticRootDir for &'_ T[src]

Loading content...

Implementors

Loading content...