[−][src]Struct http_fs::file::ServeFile
File service helper
Fields
content_type: MimeFile's MIME type
content_disposition: ContentDispositionFile's Content-Disposition
Methods
impl ServeFile<DefaultConfig>[src]
pub fn from_parts(file_name: &str, file: File, meta: Metadata) -> Self[src]
Creates new instance from already opened file
impl<C: FileServeConfig> ServeFile<C>[src]
pub fn open(path: &Path) -> Result<Self>[src]
Opens file to serve.
pub fn from_parts_with_cfg(file_name: &str, file: File, meta: Metadata) -> Self[src]
Creates new instance from already opened file
pub fn etag(&self) -> EntityTag[src]
Creates EntityTag for file
pub fn last_modified(&self) -> Option<HttpDate>[src]
Creates HttpDate instance for file, if possible
pub fn len(&self) -> u64[src]
Returns length of File.
pub fn prepare(
self,
path: &Path,
method: Method,
headers: &HeaderMap,
out_headers: &mut HeaderMap,
workers: &ThreadPool
) -> (StatusCode, Option<ChunkedReadFile<C>>)[src]
self,
path: &Path,
method: Method,
headers: &HeaderMap,
out_headers: &mut HeaderMap,
workers: &ThreadPool
) -> (StatusCode, Option<ChunkedReadFile<C>>)
Prepares file for service
Trait Implementations
Auto Trait Implementations
impl<C> Unpin for ServeFile<C> where
C: Unpin,
C: Unpin,
impl<C> Sync for ServeFile<C> where
C: Sync,
C: Sync,
impl<C> Send for ServeFile<C> where
C: Send,
C: Send,
impl<C> UnwindSafe for ServeFile<C> where
C: UnwindSafe,
C: UnwindSafe,
impl<C> RefUnwindSafe for ServeFile<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,