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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)