pub fn download_url_with(
        &self,
        duration: u32,
        opts: crate::DownloadOptions,
    ) -> crate::Result<String> {
        self.sign(&self.name, duration, "GET", opts.content_disposition)
    }
/// Creates a [Signed Url](https://cloud.google.com/storage/docs/access-control/signed-urls)
/// which is valid for `duration` seconds, and lets the posessor download the file contents
/// without any authentication.
/// ### Example
/// ```no_run
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// use cloud_storage::object::{Object, ComposeRequest};
///
/// let obj1 = Object::read("my_bucket", "file1").await?;
/// let url = obj1.download_url(50)?;
/// // url is now a url to which an unauthenticated user can make a request to download a file
/// // for 50 seconds.
/// # Ok(())
/// # }
/// ```
Creates a [Signed Url]
which is valid for `duration` seconds, and lets the posessor download the file contents
without any authentication.
Creates a [ Signed Url ] which is valid for ` duration ` seconds and lets the posessor download the file contents without any authentication .
pub fn download_url_with(
        &self,
        duration: u32,
        opts: crate::DownloadOptions,
    ) -> crate::Result<String> {
        self.sign(&self.name, duration, "GET", opts.content_disposition)
    }
pub fn download_url_with ( & self , duration : u32 , opts : crate :: DownloadOptions , ) -> crate :: Result < String > { self . sign ( & self . name , duration , " " , opts . content_disposition ) }
Creates a [Signed Url](https://cloud.google.com/storage/docs/access-control/signed-urls)
which is valid for `duration` seconds, and lets the posessor download the file contents
without any authentication.
Creates a [ Signed Url ] ( https : // cloud . google . com / storage / docs / access - control / signed - urls ) which is valid for ` duration ` seconds and lets the posessor download the file contents without any authentication .
&self
duration
u32
opts
crate::DownloadOptions
example
None
#[tokio::main]
None
async fn main() -> result<(), box<dyn std::error::error>> {
use cloud_storage::object::{Object, ComposeRequest}.

let obj1 = Object::read("my_bucket", "file1").await?;
let url = obj1.download_url(50)?;
url is now a url to which an unauthenticated user can make a request to download a file
for 50 seconds.
use cloud_storage :: object :: { Object ComposeRequest } . let obj1 = Object :: read ( " my_bucket " " file1 " ) . await? ; let url = obj1 . download_url ( 50 ) ? ; url is now a url to which an unauthenticated user can make a request to download a file for 50 seconds .
ok(())
None
}
None