pub struct Download { /* private fields */ }Expand description
A buffered binary response with safe download headers.
Implementations§
Source§impl Download
impl Download
pub fn attachment( body: impl Into<Bytes>, file_name: impl Into<String>, content_type: Mime, ) -> Self
pub fn inline( body: impl Into<Bytes>, file_name: impl Into<String>, content_type: Mime, ) -> Self
Sourcepub fn with_cache_control(
self,
value: impl TryInto<HeaderValue>,
) -> Result<Self, InvalidHeader>
pub fn with_cache_control( self, value: impl TryInto<HeaderValue>, ) -> Result<Self, InvalidHeader>
Override the conservative private download cache policy.
§Errors
Returns InvalidHeader when the value contains invalid header bytes.
Trait Implementations§
Source§impl IntoResponse for Download
impl IntoResponse for Download
fn into_response(self) -> Response
Auto Trait Implementations§
impl !Freeze for Download
impl RefUnwindSafe for Download
impl Send for Download
impl Sync for Download
impl Unpin for Download
impl UnsafeUnpin for Download
impl UnwindSafe for Download
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