pub async fn download(bucket: &str, file_name: &str) -> Result<Vec<u8>, Error> {
        let url = format!(
            "{}/b/{}/o/{}?alt=media",
            crate::BASE_URL,
            percent_encode(bucket),
            percent_encode(file_name),
        );
        Ok(crate::CLIENT
            .get(&url)
            .headers(crate::get_headers().await?)
            .send()
            .await?
            .error_for_status()?
            .bytes()
            .await?
            .to_vec())
    }
/// Download the content of the object with the specified name in the specified bucket.
/// ### Example
/// ```no_run
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// use cloud_storage::Object;
///
/// let bytes = Object::download("my_bucket", "path/to/my/file.png").await?;
/// # Ok(())
/// # }
/// ```
Download the content of the object with the specified name in the specified bucket.
Download the content of the object with the specified name in the specified bucket .
pub async fn download(bucket: &str, file_name: &str) -> Result<Vec<u8>, Error> {
        let url = format!(
            "{}/b/{}/o/{}?alt=media",
            crate::BASE_URL,
            percent_encode(bucket),
            percent_encode(file_name),
        );
        Ok(crate::CLIENT
            .get(&url)
            .headers(crate::get_headers().await?)
            .send()
            .await?
            .error_for_status()?
            .bytes()
            .await?
            .to_vec())
    }
pub async fn download ( bucket : & str , file_name : & str ) -> Result < Vec < u8 > , Error > { let url = format ! ( " " crate BASE_URL percent_encode ( bucket ) percent_encode ( file_name ) ) ; Ok ( crate :: CLIENT . get ( & url ) . headers ( crate :: get_headers ( ) . await ? ) . send ( ) . await ? . error_for_status ( ) ? . bytes ( ) . await ? . to_vec ( ) ) }
Download the content of the object with the specified name in the specified bucket.
Download the content of the object with the specified name in the specified bucket .
bucket
&str
file_name
&str
example
None
#[tokio::main]
None
async fn main() -> result<(), box<dyn std::error::error>> {
use cloud_storage::Object.

let bytes = Object::download("my_bucket", "path/to/my/file.png").await?.
use cloud_storage :: Object . let bytes = Object :: download ( " my_bucket " " path / to / my / file . png " ) . await? .
ok(())
None
}
None