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