Struct b2_client::file::DownloadFile
source · [−]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
sourceimpl<'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 where
C: HttpClient<Error = Error<E>> + 'b,
D: Into<&'b DownloadAuth<'b, C>>,
E: Debug + Display,
pub fn public_url<'b, C, D, E>(&self, auth: D) -> String where
C: HttpClient<Error = Error<E>> + 'b,
D: Into<&'b DownloadAuth<'b, C>>,
E: Debug + Display,
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.
Trait Implementations
sourceimpl<'a> Debug for DownloadFile<'a>
impl<'a> Debug for DownloadFile<'a>
sourceimpl<'a> Serialize for DownloadFile<'a>
impl<'a> Serialize for DownloadFile<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for DownloadFile<'a>
impl<'a> Send for DownloadFile<'a>
impl<'a> Sync for DownloadFile<'a>
impl<'a> Unpin for DownloadFile<'a>
impl<'a> UnwindSafe for DownloadFile<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more