cloud_storage/download_options.rs
1/// A set of parameters that can be used to customise signed urls.
2#[derive(Default)]
3pub struct DownloadOptions {
4 pub(crate) content_disposition: Option<String>,
5}
6
7impl DownloadOptions {
8 /// Create a new instance of `DownloadOptions`. Equivalent to `DownloadOptions::default()`.
9 ///
10 /// ### Example
11 /// ```rust
12 /// use cloud_storage::DownloadOptions;
13 ///
14 /// let opts = DownloadOptions::new();
15 /// ```
16 pub fn new() -> Self {
17 Self::default()
18 }
19
20 /// Create a new instance of `DownloadOptions`. Equivalent to `DownloadOptions::default()`.
21 ///
22 /// ### Example
23 /// ```rust
24 /// use cloud_storage::DownloadOptions;
25 ///
26 /// let opts = DownloadOptions::new()
27 /// .content_disposition("attachment");
28 /// ```
29 pub fn content_disposition(mut self, content_disposition: &str) -> Self {
30 self.content_disposition = Some(content_disposition.to_string());
31 self
32 }
33}