pub struct DownloadFile<'a> { /* private fields */ }
Expand description
A request to download a file or a portion of a file from the B2 API.
A simple file request can be created via with_name or with_id; for more complex requests use a DownloadFileBuilder.
If you use self-managed server-side encryption, you must use DownloadFileBuilder to pass the encryption information.
See https://www.backblaze.com/b2/docs/b2_download_file_by_id.html for information on downloading files, including the list of headers that may be returned.
Implementations§
Source§impl<'a> DownloadFile<'a>
impl<'a> DownloadFile<'a>
Sourcepub fn with_name(name: &str, bucket: &'a str) -> Self
pub fn with_name(name: &str, bucket: &'a str) -> Self
Download a file with the specified file name.
The name will be percent-encoded.
pub fn builder() -> DownloadFileBuilder<'a>
Sourcepub fn public_url<'b, C, D, E>(&self, auth: D) -> String
pub fn public_url<'b, C, D, E>(&self, auth: D) -> String
Generate the public URL for a GET request for a file in a public bucket.
A file in a public bucket does not require an authorization token to access, making this link suitable for distribution (e.g., embedding in a web page).
You must provide an Authorization or DownloadAuthorization that has access to the file.