Struct backblaze_b2::raw::authorize::B2Authorization [] [src]

pub struct B2Authorization<'a> {
    pub credentials: &'a B2Credentials,
    pub authorization_token: String,
    pub api_url: String,
    pub download_url: String,
    pub recommended_part_size: usize,
    pub absolute_minimum_part_size: usize,
}

This struct contains the needed authorization to perform any b2 api call. It is typically created using a B2Credentials.

Fields

Methods

impl<'a> B2Authorization<'a>
[src]

Returns a hyper header that correctly authorizes an api call to backblaze.

impl<'a> B2Authorization<'a>
[src]

Methods related to the buckets module.

Performs a b2_list_buckets api call.

Errors

This function returns a B2Error in case something goes wrong. This function is only going to fail with the standard errors.

Performs a b2_create_bucket api call.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_maximum_bucket_limit, is_duplicate_bucket_name and is_invalid_bucket_name.

Performs a b2_create_bucket api call. This function initializes the bucket with no info.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_maximum_bucket_limit, is_duplicate_bucket_name and is_invalid_bucket_name.

Performs a b2_delete_bucket api call.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_bucket_not_found.

Performs a b2_delete_bucket api call.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_bucket_not_found.

impl<'a> B2Authorization<'a>
[src]

Methods related to the files module.

Performs a b2_get_file_info 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.

Performs a b2_list_file_names api call. This function returns at most max_file_count files.

In order to list all the files on b2, pass None as start_file_name on the first call to this function and to subsequent calls pass the Option returned by this function to the next call of this function, until that Option is None. This is also done by the convenience function list_all_file_names.

Filenames hidden by a hide marker are not returned.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_bucket_not_found, is_invalid_file_name, is_prefix_issue, is_invalid_delimiter.

Uses the function list_file_names several times in order to download a list of all file names on b2.

Filenames hidden by a hide marker are not returned.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_bucket_not_found, is_prefix_issue, is_invalid_delimiter.

Performs a b2_list_file_versions api call. This function returns at most max_file_count files.

In order to list all the files on b2, pass None as start_file_name on the first call to this function and to subsequent calls pass the Option returned by this function to the next call of this function, until that Option is None. This is also done by the convenience function list_all_file_names.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_bucket_not_found, is_invalid_file_name, is_prefix_issue and is_invalid_delimiter.

Uses the function list_file_versions several times in order to download a list of all file versions on b2.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_bucket_not_found, is_prefix_issue and is_invalid_delimiter.

Performs a b2_delete_file_version api call.

This function also works on unfinished large files and hide markers.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_file_not_found.

Performs a b2_hide_file api call.

This function creates a hide marker with the given name.

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_bucket_not_found, is_file_already_hidden and is_invalid_file_name.

impl<'a> B2Authorization<'a>
[src]

Methods related to the upload module.

Performs a b2_get_upload_url api call and returns the upload url wrapped in an UploadAuthorization.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_bucket_not_found.

impl<'a> B2Authorization<'a>
[src]

Methods related to the download module.

Use the authorization token in this B2Authorization as a download authorization. The DownloadAuthorization returned by this function can download any file on any bucket owned by this user.

Performs a b2_get_download_authorization api call. The DownloadAuthorization returned by this method can only download files from the specified bucket and with the specified prefix.

Errors

This function returns a B2Error in case something goes wrong. Besides the standard errors, this function can fail with is_bucket_not_found.

Trait Implementations

impl<'a> Debug for B2Authorization<'a>
[src]

Formats the value using the given formatter.