Skip to main content

azure_lite_rs/
lib.rs

1//! Lightweight HTTP client for Microsoft Azure APIs.
2//!
3//! Provides REST API access with automatic Bearer token injection,
4//! retry, and rate limiting.
5
6pub mod api;
7pub mod auth;
8pub mod client;
9pub mod error;
10#[cfg(any(test, feature = "test-support"))]
11pub mod mock_client;
12pub mod ops;
13#[cfg(any(test, feature = "test-support"))]
14pub mod test_support;
15pub mod types;
16
17pub use auth::{AzureCredential, default_credential};
18pub use client::{AzureHttpClient, AzureHttpClientBuilder, AzureResponse};
19pub use error::{AzureError, Result};
20#[cfg(any(test, feature = "test-support"))]
21pub use mock_client::MockClient;
22
23/// Build a URL query string from key-value pairs, omitting any with empty values.
24#[allow(dead_code)]
25pub(crate) fn append_query_params(url: String, params: &[(&str, &str)]) -> String {
26    let qs: Vec<String> = params
27        .iter()
28        .filter(|(_, v)| !v.is_empty())
29        .map(|(k, v)| format!("{}={}", k, urlencoding::encode(v)))
30        .collect();
31    if qs.is_empty() {
32        url
33    } else {
34        format!("{}?{}", url, qs.join("&"))
35    }
36}