pub struct FileResponse { /* private fields */ }Available on crate feature
server only.Expand description
Response for sending a file.
Implementations§
Source§impl FileResponse
impl FileResponse
Sourcepub fn new<P>(path: P, content_type: HeaderValue) -> Result<Self>
pub fn new<P>(path: P, content_type: HeaderValue) -> Result<Self>
Create a new FileResponse with given path and Content-Type
Sourcepub fn new_with_guess_type<P>(path: P) -> Result<Self>
pub fn new_with_guess_type<P>(path: P) -> Result<Self>
Create a new FileResponse with guessing Content-Type through file name
Trait Implementations§
Source§impl IntoResponse for FileResponse
impl IntoResponse for FileResponse
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Consume self and convert it into a
ResponseAuto Trait Implementations§
impl !Freeze for FileResponse
impl RefUnwindSafe for FileResponse
impl Send for FileResponse
impl Sync for FileResponse
impl Unpin for FileResponse
impl UnwindSafe for FileResponse
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