pub struct Roots(Vec<(PathBuf, Option<PathBuf>)>);Expand description
The directories files are served from, in order, each with its real path (symbolic links resolved).
Tuple Fields§
§0: Vec<(PathBuf, Option<PathBuf>)>Implementations§
Source§impl Roots
impl Roots
pub fn new(dirs: &[PathBuf]) -> Self
Sourcefn open(&self, path: &str) -> Found
fn open(&self, path: &str) -> Found
Open the file a request path names, from the first root that has it
(index.html for a directory), unless it is really outside that
root: a symbolic link may lead anywhere on the machine. The file is
checked after it is opened, and served from what was opened, so a
link swapped in meanwhile is caught too.
Auto Trait Implementations§
impl Freeze for Roots
impl RefUnwindSafe for Roots
impl Send for Roots
impl Sync for Roots
impl Unpin for Roots
impl UnsafeUnpin for Roots
impl UnwindSafe for Roots
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