Struct backblaze_b2::raw::download::DownloadAuthorization
[−]
[src]
pub struct DownloadAuthorization<'a> { pub authorization_token: String, pub bucket_id: Option<String>, pub file_name_prefix: String, pub download_url: &'a str, }
Contains the authorization and access data concerning a download authorization on backblaze.
This struct is usually obtained from a B2Authorization
using the methods
to_download_authorization
and get_download_authorization
.
Fields
bucket_id: Option<String>
file_name_prefix: String
download_url: &'a str
Methods
impl<'a> DownloadAuthorization<'a>
[src]
fn auth_header(&self) -> B2AuthHeader
Returns a hyper header that can be added to download requests on the backblaze api.
fn allows_bucket(&self, bucket: &str) -> bool
Tests whether this download authorization allows access to the given bucket
impl<'a> DownloadAuthorization<'a>
[src]
fn download_file_by_id<InfoType>(
&self,
file_id: &str,
client: &Client
) -> Result<(Response, Option<FileInfo<InfoType>>), B2Error> where
InfoType: Deserialize<'de>,
&self,
file_id: &str,
client: &Client
) -> Result<(Response, Option<FileInfo<InfoType>>), B2Error> where
InfoType: Deserialize<'de>,
Performs a b2_download_file_by_id api call.
Errors
This function returns a B2Error
in case something goes wrong. Besides the standard
errors, this function can fail with is_file_not_found
.
fn download_range_by_id<InfoType>(
&self,
file_id: &str,
range_min: u64,
range_max: u64,
client: &Client
) -> Result<(Response, Option<FileInfo<InfoType>>), B2Error> where
InfoType: Deserialize<'de>,
&self,
file_id: &str,
range_min: u64,
range_max: u64,
client: &Client
) -> Result<(Response, Option<FileInfo<InfoType>>), B2Error> where
InfoType: Deserialize<'de>,
Performs a b2_download_file_by_id api call. This function specifies the range of the file to download, and the range_max parameter is inclusive.
Errors
This function returns a B2Error
in case something goes wrong. Besides the standard
errors, this function can fail with is_file_not_found
and is_range_out_of_bounds
.
fn download_file_by_name<InfoType>(
&self,
bucket_name: &str,
file_name: &str,
client: &Client
) -> Result<(Response, Option<FileInfo<InfoType>>), B2Error> where
InfoType: Deserialize<'de>,
&self,
bucket_name: &str,
file_name: &str,
client: &Client
) -> Result<(Response, Option<FileInfo<InfoType>>), B2Error> where
InfoType: Deserialize<'de>,
Performs a b2_download_file_by_name api call.
Errors
This function returns a B2Error
in case something goes wrong. Besides the standard
errors, this function can fail with is_file_not_found
and is_bucket_not_found
.
fn download_range_by_name<InfoType>(
&self,
bucket_name: &str,
file_name: &str,
range_min: u64,
range_max: u64,
client: &Client
) -> Result<(Response, Option<FileInfo<InfoType>>), B2Error> where
InfoType: Deserialize<'de>,
&self,
bucket_name: &str,
file_name: &str,
range_min: u64,
range_max: u64,
client: &Client
) -> Result<(Response, Option<FileInfo<InfoType>>), B2Error> where
InfoType: Deserialize<'de>,
Performs a b2_download_file_by_name api call. This function specifies the range of the file to download, and the range_max parameter is inclusive.
Errors
This function returns a B2Error
in case something goes wrong. Besides the standard
errors, this function can fail with is_file_not_found
, is_range_out_of_bounds
and
is_bucket_not_found
.
Trait Implementations
impl<'a> Clone for DownloadAuthorization<'a>
[src]
fn clone(&self) -> DownloadAuthorization<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more