pub struct BlobClient { /* private fields */ }Expand description
A client for handling blobs
For a full list of operations available on blobs, check out the Azure documentation.
Implementations§
Source§impl BlobClient
 
impl BlobClient
pub fn from_sas_url(url: &Url) -> Result<Self>
Sourcepub fn get(&self) -> GetBlobBuilder
 
pub fn get(&self) -> GetBlobBuilder
Stream a blob in chunks.
By default, blobs are downloaded in 1MB chunks to reduce the impact of intermittent network issues while downloading large blobs.
Sourcepub async fn get_content(&self) -> Result<Vec<u8>>
 
pub async fn get_content(&self) -> Result<Vec<u8>>
Return an entire blob.
Sourcepub fn get_properties(&self) -> GetPropertiesBuilder
 
pub fn get_properties(&self) -> GetPropertiesBuilder
Get all user-defined metadata, standard HTTP properties, and system properties for the blob.
Sourcepub fn set_properties(&self) -> SetPropertiesBuilder
 
pub fn set_properties(&self) -> SetPropertiesBuilder
Set blob properties.
Several properties are cleared from the blob if not passed.
Consider calling set_from_blob_properties with existing blob properties.
Sourcepub fn get_metadata(&self) -> GetMetadataBuilder
 
pub fn get_metadata(&self) -> GetMetadataBuilder
Get all user-defined metadata for the blob.
Sourcepub fn set_metadata(&self) -> SetMetadataBuilder
 
pub fn set_metadata(&self) -> SetMetadataBuilder
Set all user-defined metadata of the blob
Sourcepub fn set_blob_tier(&self, access_tier: AccessTier) -> SetBlobTierBuilder
 
pub fn set_blob_tier(&self, access_tier: AccessTier) -> SetBlobTierBuilder
Set the access tier on the blob.
Sourcepub fn set_blob_expiry(&self, blob_expiry: BlobExpiry) -> SetBlobExpiryBuilder
 
pub fn set_blob_expiry(&self, blob_expiry: BlobExpiry) -> SetBlobExpiryBuilder
Set an expiry time on an existing blob.
This operation is only allowed on Hierarchical Namespace enabled accounts.
ref: https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-expiry
Sourcepub fn put_page_blob(&self, length: u128) -> PutPageBlobBuilder
 
pub fn put_page_blob(&self, length: u128) -> PutPageBlobBuilder
Creates a new page blob.
Sourcepub fn put_append_blob(&self) -> PutAppendBlobBuilder
 
pub fn put_append_blob(&self) -> PutAppendBlobBuilder
Creates a new append blob.
Sourcepub fn put_block_blob(&self, body: impl Into<Body>) -> PutBlockBlobBuilder
 
pub fn put_block_blob(&self, body: impl Into<Body>) -> PutBlockBlobBuilder
Creates a new block blob, or update the content of an existing block blob.
Sourcepub fn copy(&self, copy_source: Url) -> CopyBlobBuilder
 
pub fn copy(&self, copy_source: Url) -> CopyBlobBuilder
Copy the blob to a destination within the storage account.
Sourcepub fn copy_from_url(&self, copy_source: Url) -> CopyBlobFromUrlBuilder
 
pub fn copy_from_url(&self, copy_source: Url) -> CopyBlobFromUrlBuilder
Copy the blob to a destination within the storage account synchronously.
Sourcepub fn acquire_lease<LD: Into<LeaseDuration>>(
    &self,
    lease_duration: LD,
) -> AcquireLeaseBuilder
 
pub fn acquire_lease<LD: Into<LeaseDuration>>( &self, lease_duration: LD, ) -> AcquireLeaseBuilder
Create a lease on the blob to lock for write and delete operations.
Sourcepub fn break_lease(&self) -> BreakLeaseBuilder
 
pub fn break_lease(&self) -> BreakLeaseBuilder
End the lease but ensure that another client cannot acquire a new lease until the current lease period has expired.
Sourcepub fn delete(&self) -> DeleteBlobBuilder
 
pub fn delete(&self) -> DeleteBlobBuilder
Delete the blob.
Sourcepub fn delete_snapshot(&self, snapshot: Snapshot) -> DeleteBlobSnapshotBuilder
 
pub fn delete_snapshot(&self, snapshot: Snapshot) -> DeleteBlobSnapshotBuilder
Delete a snapshot of the blob.
Sourcepub fn delete_version_id(
    &self,
    version_id: VersionId,
) -> DeleteBlobVersionBuilder
 
pub fn delete_version_id( &self, version_id: VersionId, ) -> DeleteBlobVersionBuilder
Delete the blob at a specific version.
Sourcepub fn put_block(
    &self,
    block_id: impl Into<BlockId>,
    body: impl Into<Body>,
) -> PutBlockBuilder
 
pub fn put_block( &self, block_id: impl Into<BlockId>, body: impl Into<Body>, ) -> PutBlockBuilder
Creates a new block to be committed as part of a block blob.
Sourcepub fn put_block_url(
    &self,
    block_id: impl Into<BlockId>,
    copy_source: Url,
) -> PutBlockUrlBuilder
 
pub fn put_block_url( &self, block_id: impl Into<BlockId>, copy_source: Url, ) -> PutBlockUrlBuilder
Creates a new block to be committed as part of a block blob, from a URL.
Sourcepub fn get_block_list(&self) -> GetBlockListBuilder
 
pub fn get_block_list(&self) -> GetBlockListBuilder
Retrieve the list of blocks that have been uploaded as part of a block blob.
Retrieve the user-defined tags for the specified blob, version, or snapshot.
Set user-defined tags for the specified blob, version, or snapshot.
Sourcepub fn put_block_list(&self, block_list: BlockList) -> PutBlockListBuilder
 
pub fn put_block_list(&self, block_list: BlockList) -> PutBlockListBuilder
Write a block blob by specifying the list of block IDs that make up the blob.
In order to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block operation.
Sourcepub fn put_page(
    &self,
    ba512_range: BA512Range,
    content: impl Into<Body>,
) -> PutPageBuilder
 
pub fn put_page( &self, ba512_range: BA512Range, content: impl Into<Body>, ) -> PutPageBuilder
Write a range of pages to a page blob.
Sourcepub fn get_page_ranges(&self) -> GetPageRangesBuilder
 
pub fn get_page_ranges(&self) -> GetPageRangesBuilder
Return the list of valid page ranges for a page blob or snapshot of a page blob.
Sourcepub fn append_block(&self, body: impl Into<Body>) -> AppendBlockBuilder
 
pub fn append_block(&self, body: impl Into<Body>) -> AppendBlockBuilder
Commits a new block of data to the end of an existing append blob.
Sourcepub fn clear_page(&self, ba512_range: BA512Range) -> ClearPageBuilder
 
pub fn clear_page(&self, ba512_range: BA512Range) -> ClearPageBuilder
Clear range of pages in a page blob.
Create a shared access signature.
Sourcepub fn generate_signed_blob_url<T>(&self, signature: &T) -> Result<Url>where
    T: SasToken,
 
pub fn generate_signed_blob_url<T>(&self, signature: &T) -> Result<Url>where
    T: SasToken,
Create a signed blob url
Sourcepub fn snapshot(&self) -> SnapshotBlobBuilder
 
pub fn snapshot(&self) -> SnapshotBlobBuilder
Create a blob snapshot
pub fn blob_name(&self) -> &str
Sourcepub fn blob_lease_client(&self, lease_id: LeaseId) -> BlobLeaseClient
 
pub fn blob_lease_client(&self, lease_id: LeaseId) -> BlobLeaseClient
Turn into a BlobLeaseClient
pub fn container_client(&self) -> &ContainerClient
Trait Implementations§
Source§impl Clone for BlobClient
 
impl Clone for BlobClient
Source§fn clone(&self) -> BlobClient
 
fn clone(&self) -> BlobClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BlobClient
impl !RefUnwindSafe for BlobClient
impl Send for BlobClient
impl Sync for BlobClient
impl Unpin for BlobClient
impl !UnwindSafe for BlobClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> Instrument for T
 
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more