Struct tiny_file_server::FileServer
source · pub struct FileServer { /* private fields */ }
Implementations
sourceimpl FileServer
impl FileServer
pub fn http(addr: impl ToSocketAddrs + Display) -> Result<Self, Error>
pub fn with_default_file(self, file_name: impl Into<Cow<'static, str>>) -> Self
pub fn with_default_content_type(
self,
content_type: impl Into<Cow<'static, str>>
) -> Self
pub fn with_content_type_by_extension(
self,
content_types: impl IntoIterator<Item = (&'static str, &'static str)>
) -> Self
pub fn set_default_file(&mut self, file_name: impl Into<Cow<'static, str>>)
pub fn set_default_content_type(
&mut self,
content_type: impl Into<Cow<'static, str>>
)
pub fn content_type_by_extension(&self) -> &HashMap<&'static str, &'static str>
pub fn content_type_by_extension_mut(
&mut self
) -> &mut HashMap<&'static str, &'static str>
pub fn unblock(&self)
pub fn run(&self, statics_path: impl Into<PathBuf>) -> Result<(), Error>
Auto Trait Implementations
impl !RefUnwindSafe for FileServer
impl Send for FileServer
impl Sync for FileServer
impl Unpin for FileServer
impl !UnwindSafe for FileServer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more