Struct backblaze_b2::raw::upload::UploadAuthorization [] [src]

pub struct UploadAuthorization {
    pub bucket_id: String,
    pub upload_url: String,
    pub authorization_token: String,
}

Contains the information needed to authorize an upload to b2. This struct is usually obtained from a B2Authorization using the method get_upload_url.

The b2 website specifies that you may not upload to the same url in parallel.

Fields

Methods

impl UploadAuthorization
[src]

Returns a hyper header that authorizes an upload request.

impl UploadAuthorization
[src]

Equivalent to calling create_upload_file_request, writing everything in the Read to the Writer and calling finish.

Starts a request to upload a file to backblaze b2. This function returns an UploadFileRequest, which implements Write. When writing to this object, the data is sent to backblaze b2. This method of uploading can be used to implement things such as rate limiting of the request.

After the file has been sent, you need to call the finish method on the UploadFileRequest, in order to close the connection.

The upload_file method can be used to upload any Reader easily. The backblaze api supports not specifying the sha1 checksum. This is not recommended, but if you wish to do this, simply pass the string do_not_verify as the sha1 checksum.

The function create_upload_file_request_sha1_at_end might be of interest. This function behaves identically to this function, except the sha1 is passed when calling finish instead of before initiating the request.

Read the backblaze api documentation for more information.

Errors

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

Starts a request to upload a file to backblaze b2. This function returns an UploadFileRequestSha1End, which implements Write. When writing to this object, the data is sent to backblaze b2. This method of uploading can be used to implement things such as rate limiting of the request.

The value of the content_length parameter must be exactly the amount of bytes you are going to write, not including the 40 byte sha1 appended by the finish method.

After the file has been sent, you need to call the finish method on the UploadFileRequestSha1End, in order to close the connection.

Read the backblaze api documentation for more information.

Errors

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

Trait Implementations

impl Clone for UploadAuthorization
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for UploadAuthorization
[src]

Formats the value using the given formatter.