volga 0.9.1

Easy & Fast Web Framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! File System tools and abstractions

use mime::Mime;
use std::path::Path;

#[cfg(feature = "static-files")]
pub mod static_files;

/// Returns a file MIME type or `application/octet-stream` if unable to determine
#[inline]
pub fn get_mime_or_octet_stream<P: AsRef<Path>>(path: P) -> Mime {
    mime_guess::from_path(&path).first_or_octet_stream()
}