pub struct DownloadResponse<'a> {
pub data: Box<dyn Read + 'a>,
pub file_name: String,
pub content_type: Option<Mime>,
pub content_length: Option<u64>,
}
Expand description
The response struct used for client downloading.
Fields§
§data: Box<dyn Read + 'a>
§file_name: String
§content_type: Option<Mime>
§content_length: Option<u64>
Implementations§
source§impl<'a> DownloadResponse<'a>
impl<'a> DownloadResponse<'a>
sourcepub fn from_file<P: AsRef<Path>, S: Into<String>>(
path: P,
file_name: Option<S>,
content_type: Option<Mime>
) -> Result<DownloadResponse<'a>>
pub fn from_file<P: AsRef<Path>, S: Into<String>>(
path: P,
file_name: Option<S>,
content_type: Option<Mime>
) -> Result<DownloadResponse<'a>>
Create a DownloadResponse
instance from a path of a file.
Trait Implementations§
source§impl<'a> Responder<'a> for DownloadResponse<'a>
impl<'a> Responder<'a> for DownloadResponse<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DownloadResponse<'a>
impl<'a> !Send for DownloadResponse<'a>
impl<'a> !Sync for DownloadResponse<'a>
impl<'a> Unpin for DownloadResponse<'a>
impl<'a> !UnwindSafe for DownloadResponse<'a>
Blanket Implementations§
§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
§fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
Converts
self
into a collection.