copy

Function copy 

Source
pub async fn copy(
    config: Config,
    client: HttpClient,
    source: impl Into<Location<'_>>,
    destination: impl Into<Location<'_>>,
    cancel: CancellationToken,
    events: Option<Sender<TransferEvent>>,
) -> Result<()>
Expand description

Copies a source location to a destination location.

A location may either be a local path or a remote URL.

If provided, the events sender will be used to send transfer events.

Note: copying between two remote locations is not supported.

§Azure Blob Storage

Supported remote URLs for Azure Blob Storage:

  • az schemed URLs in the format az://<account>/<container>/<blob>.
  • https schemed URLs in the format https://<account>.blob.core.windows.net/<container>/<blob>.

If authentication is required, the URL is expected to contain a SAS token in its query parameters.

§Amazon S3

Supported remote URLs for S3 Storage:

  • s3 schemed URLs in the format: s3://<bucket>/<object> (note: uses the default region).
  • https schemed URLs in the format https://<bucket>.s3.<region>.amazonaws.com/<object>.
  • https schemed URLs in the format https://<region>.s3.amazonaws.com/<bucket>/<object>.

If authentication is required, the provided Config must have S3 authentication information.

§Google Cloud Storage

Supported remote URLs for Google Cloud Storage:

  • gs schemed URLs in the format: gs://<bucket>/<object>.
  • https schemed URLs in the format https://<bucket>.storage.googleapis.com/<object>.
  • https schemed URLs in the format https://storage.googleapis.com/<bucket>/<object>.

If authentication is required, the provided Config must have Google authentication information.

Note that HMAC authentication is used for Google Cloud Storage access.