pub struct CopyFileBuilder<'a> { /* private fields */ }
Expand description

A builder to create a CopyFile request.

See https://www.backblaze.com/b2/docs/b2_copy_file.html for further information.

Implementations

Obtain the source file ID and encryption settings for the copy operation.

Set the source file ID of the file to copy.

Set the destination bucket for the new file.

If not provided, the same bucket ID as the source file is used.

Both buckets must belong to the same account.

Set the filename to use for the new file.

If provided, only copy the specified byte range of the source file.

Determine whether to copy the source metadata to the new file.

If MetadataDirective::Copy (the default), the source metadata will be copied to the new file.

If MetadataDirective::Replace, the new file’s metadata will be empty or determined by the information provided via content_type and file_info.

Set the content-type of the file.

The content-type can only be set if metadata_directive is MetadataDirective::Replace.

Set user-specified file metadata.

The file information can only be set if metadata_directive is MetadataDirective::Replace.

For the following headers, use their corresponding methods instead of setting the values here:

If any of the above are set here and via their methods, the value from the method will override the value specified here.

Set the file-retention settings for the new file.

Setting this requires Capability::WriteFileRetentions.

Enable legal hold status for the new file.

Do not enable legal hold status for the new file.

Specify the server-side encryption settings on the source file.

Calling source_file will set this from the file object.

Specify the server-side encryption settings for the destination file.

If not provided, the bucket’s default settings will be used.

The time of the file’s last modification.

The SHA1 checksum of the file’s contents.

B2 will use this to verify the accuracy of the file upload, and it will be returned in the header X-Bz-Content-Sha1 when downloading the file.

The value to use for the Content-Disposition header when downloading the file.

Note that the download request can override this value.

The value to use for the Content-Language header when downloading the file.

Note that the download request can override this value.

The value to use for the Expires header when the file is downloaded.

Note that the download request can override this value.

The value to use for the Cache-Control header when the file is downloaded.

This would override the value set at the bucket level, and can be overriden by a download request.

The value to use for the Content-Encoding header when the file is downloaded.

Note that this can be overriden by a download request.

Create a CopyFile object.

Returns

Returns ValidationError::MissingData if the source file or destination filename are not set.

Returns ValidationError::Incompatible if the metadata_directive is MetadataDirective::Copy or was not provided AND content_type or file_info were set.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.