pub struct BlobServiceClient { /* private fields */ }Implementations§
Source§impl BlobServiceClient
impl BlobServiceClient
Sourcepub fn new(
service_url: Url,
credential: Option<Arc<dyn TokenCredential>>,
options: Option<BlobServiceClientOptions>,
) -> Result<Self>
pub fn new( service_url: Url, credential: Option<Arc<dyn TokenCredential>>, options: Option<BlobServiceClientOptions>, ) -> Result<Self>
Creates a new BlobServiceClient from a service URL.
§Arguments
service_url- The full URL of the Azure storage account, for examplehttps://myaccount.blob.core.windows.net/. The caller is responsible for percent-encoding the URL correctly; it will be used as-is.credential- An optional implementation ofTokenCredentialthat can provide an Entra ID token to use when authenticating.options- Optional configuration for the client.
Sourcepub fn blob_container_client(&self, container_name: &str) -> BlobContainerClient
pub fn blob_container_client(&self, container_name: &str) -> BlobContainerClient
Returns a new instance of BlobContainerClient.
§Arguments
container_name- The name of the container.
Sourcepub fn blob_client(&self, container_name: &str, blob_name: &str) -> BlobClient
pub fn blob_client(&self, container_name: &str, blob_name: &str) -> BlobClient
Returns a new instance of BlobClient.
§Arguments
container_name- The name of the container.blob_name- The name of the blob.
Source§impl BlobServiceClient
impl BlobServiceClient
Lists blobs across all containers whose tags match a given search expression.
§Arguments
filter_expression- Filters the results to return only blobs whose tags match the specified expression.options- Optional parameters for the request.
Sourcepub async fn get_account_info(
&self,
options: Option<BlobServiceClientGetAccountInfoOptions<'_>>,
) -> Result<Response<BlobServiceClientGetAccountInfoResult, NoFormat>>
pub async fn get_account_info( &self, options: Option<BlobServiceClientGetAccountInfoOptions<'_>>, ) -> Result<Response<BlobServiceClientGetAccountInfoResult, NoFormat>>
Returns information about the storage account.
§Arguments
options- Optional parameters for the request.
§Response Headers
The returned Response implements the BlobServiceClientGetAccountInfoResultHeaders trait, which provides
access to response headers. For example:
use azure_core::{Result, http::{Response, NoFormat}};
use azure_storage_blob::models::{BlobServiceClientGetAccountInfoResult, BlobServiceClientGetAccountInfoResultHeaders};
async fn example() -> Result<()> {
let response: Response<BlobServiceClientGetAccountInfoResult, NoFormat> = unimplemented!();
// Access response headers
if let Some(account_kind) = response.account_kind()? {
println!("x-ms-account-kind: {:?}", account_kind);
}
if let Some(is_hierarchical_namespace_enabled) = response.is_hierarchical_namespace_enabled()? {
println!("x-ms-is-hns-enabled: {:?}", is_hierarchical_namespace_enabled);
}
if let Some(sku_name) = response.sku_name()? {
println!("x-ms-sku-name: {:?}", sku_name);
}
Ok(())
}§Available headers
account_kind() - x-ms-account-kindis_hierarchical_namespace_enabled() - x-ms-is-hns-enabledsku_name() - x-ms-sku-name
Sourcepub async fn get_properties(
&self,
options: Option<BlobServiceClientGetPropertiesOptions<'_>>,
) -> Result<Response<BlobServiceProperties, XmlFormat>>
pub async fn get_properties( &self, options: Option<BlobServiceClientGetPropertiesOptions<'_>>, ) -> Result<Response<BlobServiceProperties, XmlFormat>>
Retrieves properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
§Arguments
options- Optional parameters for the request.
Sourcepub async fn get_statistics(
&self,
options: Option<BlobServiceClientGetStatisticsOptions<'_>>,
) -> Result<Response<StorageServiceStats, XmlFormat>>
pub async fn get_statistics( &self, options: Option<BlobServiceClientGetStatisticsOptions<'_>>, ) -> Result<Response<StorageServiceStats, XmlFormat>>
Retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account.
§Arguments
options- Optional parameters for the request.
Sourcepub async fn get_user_delegation_key(
&self,
key_info: RequestContent<KeyInfo, XmlFormat>,
options: Option<BlobServiceClientGetUserDelegationKeyOptions<'_>>,
) -> Result<Response<UserDelegationKey, XmlFormat>>
pub async fn get_user_delegation_key( &self, key_info: RequestContent<KeyInfo, XmlFormat>, options: Option<BlobServiceClientGetUserDelegationKeyOptions<'_>>, ) -> Result<Response<UserDelegationKey, XmlFormat>>
Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token authentication.
§Arguments
key_info- Key information provided in the request.options- Optional parameters for the request.
Sourcepub fn list_containers(
&self,
options: Option<BlobServiceClientListContainersOptions<'_>>,
) -> Result<Pager<ListContainersResponse, XmlFormat>>
pub fn list_containers( &self, options: Option<BlobServiceClientListContainersOptions<'_>>, ) -> Result<Pager<ListContainersResponse, XmlFormat>>
Returns a list of the containers in the specified account.
§Arguments
options- Optional parameters for the request.
Sourcepub async fn set_properties(
&self,
storage_service_properties: RequestContent<BlobServiceProperties, XmlFormat>,
options: Option<BlobServiceClientSetPropertiesOptions<'_>>,
) -> Result<Response<(), NoFormat>>
pub async fn set_properties( &self, storage_service_properties: RequestContent<BlobServiceProperties, XmlFormat>, options: Option<BlobServiceClientSetPropertiesOptions<'_>>, ) -> Result<Response<(), NoFormat>>
Sets properties for a storage account’s Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
§Arguments
storage_service_properties- The storage service properties to set.options- Optional parameters for the request.