Struct avml::BlobUploader

source ·
pub struct BlobUploader { /* private fields */ }
Expand description

Concurrently upload a Stream/File to an Azure Blob Store using a SAS URL.

use avml::BlobUploader;
let sas_url = Url::parse("https://contoso.com/container_name/blob_name?sas_token_here=1")
    .expect("url parsing failed");
let path = Path::new("/tmp/image.lime");
let uploader = BlobUploader::new(&sas_url)?
    .block_size(Some(100))
    .concurrency(5);
uploader.upload_file(&path).await?;

Implementations

Create a BlobUploader with a BlobClient from azure_storage_blobs.

Ref: https://docs.rs/azure_storage_blobs/latest/azure_storage_blobs/prelude/struct.BlobClient.html

Specify the size of the file to upload (in bytes)

If the anticipated upload size is not specified, the maximum file uploaded will be approximately 5TB.

Specify the block size in multiples of 1MB

If the block size is not specified and the size of the content to be uploaded is provided, the default block size will be calculated to fit within the bounds of the allowed number of blocks and the minimum minimum required to hit high-throughput block blob performance thresholds.

Upload a file to Azure Blob Store using a fully qualified SAS token

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. 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

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more