pub struct StreamableFile { /* private fields */ }Expand description
Adapter-neutral file response body, similar to Nest’s StreamableFile.
Implementations§
Source§impl StreamableFile
impl StreamableFile
pub fn bytes(body: impl Into<Vec<u8>>) -> Self
pub fn stream<S>(stream: S) -> Self
pub fn with_options(self, options: StreamableFileOptions) -> Self
pub fn with_content_type(self, content_type: impl Into<String>) -> Self
pub fn with_content_disposition( self, content_disposition: impl Into<String>, ) -> Self
pub fn with_attachment(self, file_name: impl AsRef<str>) -> Result<Self>
pub fn with_inline(self, file_name: impl AsRef<str>) -> Result<Self>
pub fn with_content_length(self, content_length: u64) -> Self
pub fn options(&self) -> &StreamableFileOptions
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StreamableFile
impl !Sync for StreamableFile
impl !UnwindSafe for StreamableFile
impl Freeze for StreamableFile
impl Send for StreamableFile
impl Unpin for StreamableFile
impl UnsafeUnpin for StreamableFile
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