Edit

Share via


What are Azure SDK for Rust crates?

Azure SDK for Rust crates enable Rust applications to access Azure services. These client libraries provide a consistent, idiomatic experience, making it easier to build secure and scalable cloud solutions with Rust and Azure.

Crates | API reference documentation | Source code

Key concepts for Azure SDK for Rust crates

  • Idiomatic Rust: Built with Rust best practices and conventions.
  • Async support: Fully async APIs with pluggable runtime support (defaulting to tokio).
  • Type safety: Uses Rust's type system for compile-time safety.
  • Thread safety: All client instance methods are thread-safe and independent of each other.
  • Memory safety: Zero-cost abstractions with no garbage collection overhead.
  • Modular design: Use only the crates you need.
  • Unified configuration: Configure service clients, logging, and retries with ClientOptions.
  • Consistent error handling: Handle errors consistently across services with azure_core::Error.
  • Response handling: Access detailed HTTP response data with Response<T>.
  • Pagination support: Work with paginated APIs by using Pager<T> for async streams.
  • Long-running operations: Wait for long-running operation (LRO) with Poller<T>
  • Authentication abstractions: Standardized credential management via TokenCredential.

Rust guidance

The Azure SDK design guidelines for Rust outline the core design principles and patterns that all Azure SDK crates follow. These guidelines ensure that SDKs are consistent, intuitive, and idiomatic for Rust, making it easier for developers to adopt and use Azure services. By adhering to these standards, the Azure SDK crates provide a familiar and predictable experience, with clear patterns for authentication, error handling, and client configuration that align with the broader Azure SDK ecosystem.

Differences between crates and REST APIs

Use the following information to understand when to use each type of access.

  • The Azure SDK crates are the preferred method for accessing your Azure service. These crates abstract away the boilerplate code required to manage cloud-based Azure platform REST requests such as authentication, retries, and logging.
  • Azure REST APIs are the preferred method if you are:
    • Working with services that don't have Azure crates available yet. Migrate your code to use Azure SDK crates when the crates become available.
    • Wanting to make REST calls directly because you don't want to use the entire crate to use a single REST API or you want deeper control over the HTTP requests.

Rust version

The Azure SDK crates are currently in beta. While the APIs are stabilizing and the crates are suitable for development and testing, some breaking changes might occur before the 1.0 release. These crates support the most commonly used Azure services, and we regularly add more based on community feedback and demand.

Azure SDK for Rust crates

Use the index of Azure SDK for Rust crates to find the available crates, their documentation, and source code.

Next steps