pub struct ServeFile<W, C> {
pub content_type: Mime,
pub content_disposition: ContentDisposition,
/* private fields */
}
Expand description
File service helper
Fields§
§content_type: Mime
File’s MIME type
content_disposition: ContentDisposition
File’s Content-Disposition
Implementations§
Source§impl<W: FsTaskSpawner, C: FileServeConfig> ServeFile<W, C>
impl<W: FsTaskSpawner, C: FileServeConfig> ServeFile<W, C>
Sourcepub fn from_parts(file_name: &str, file: File, meta: Metadata) -> Self
pub fn from_parts(file_name: &str, file: File, meta: Metadata) -> Self
Creates new instance from already opened file
Sourcepub fn from_parts_with_cfg(file_name: &str, file: File, meta: Metadata) -> Self
pub fn from_parts_with_cfg(file_name: &str, file: File, meta: Metadata) -> Self
Creates new instance from already opened file
Sourcepub fn last_modified(&self) -> Option<HttpDate>
pub fn last_modified(&self) -> Option<HttpDate>
Creates HttpDate
instance for file, if possible
Trait Implementations§
Auto Trait Implementations§
impl<W, C> Freeze for ServeFile<W, C>
impl<W, C> RefUnwindSafe for ServeFile<W, C>where
W: RefUnwindSafe,
C: RefUnwindSafe,
impl<W, C> Send for ServeFile<W, C>
impl<W, C> Sync for ServeFile<W, C>
impl<W, C> Unpin for ServeFile<W, C>
impl<W, C> UnwindSafe for ServeFile<W, C>where
W: UnwindSafe,
C: UnwindSafe,
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