azure_core/
lib.rs

1#![doc = include_str!("../README.md")]
2#![forbid(unsafe_code)]
3#![deny(missing_debug_implementations, nonstandard_style)]
4// #![warn(missing_docs, future_incompatible, unreachable_pub)]
5
6#[macro_use]
7mod macros;
8
9mod bytes_stream;
10mod constants;
11mod context;
12pub mod date;
13pub mod error;
14pub mod hmac;
15mod http_client;
16mod models;
17mod options;
18mod pageable;
19mod pipeline;
20mod policies;
21mod request;
22mod response;
23mod seekable_stream;
24
25pub mod auth;
26pub mod headers;
27pub mod lro;
28pub mod parsing;
29pub mod prelude;
30pub mod request_options;
31pub mod sleep;
32pub mod util;
33
34use uuid::Uuid;
35
36#[cfg(feature = "xml")]
37pub mod xml;
38
39pub mod tokio;
40
41pub mod base64;
42pub use bytes_stream::*;
43pub use constants::*;
44pub use context::Context;
45pub use error::{Error, Result};
46#[doc(inline)]
47pub use headers::Header;
48pub use http_client::{from_json, new_http_client, to_json, HttpClient};
49pub use models::*;
50pub use options::*;
51pub use pageable::*;
52pub use pipeline::Pipeline;
53pub use policies::*;
54pub use request::*;
55pub use response::*;
56pub use seekable_stream::*;
57pub use sleep::sleep;
58
59// re-export important types at crate level
60pub use http_types::Method;
61pub use http_types::StatusCode;
62pub use url::Url;
63
64/// A unique identifier for a request.
65// NOTE: only used for Storage?
66pub type RequestId = Uuid;
67
68/// A unique session token.
69// NOTE: only used for Cosmos?
70pub type SessionToken = String;
71
72/// An empty HTTP body.
73#[allow(clippy::declare_interior_mutable_const)]
74pub const EMPTY_BODY: bytes::Bytes = bytes::Bytes::new();
75
76/// Add a new query pair into the target URL's query string.
77pub trait AppendToUrlQuery {
78    fn append_to_url_query(&self, url: &mut crate::Url);
79}
80
81impl<T> AppendToUrlQuery for &T
82where
83    T: AppendToUrlQuery,
84{
85    fn append_to_url_query(&self, url: &mut crate::Url) {
86        (*self).append_to_url_query(url);
87    }
88}
89
90impl<T> AppendToUrlQuery for Option<T>
91where
92    T: AppendToUrlQuery,
93{
94    fn append_to_url_query(&self, url: &mut crate::Url) {
95        if let Some(i) = self {
96            i.append_to_url_query(url);
97        }
98    }
99}
100
101#[doc(hidden)]
102/// Used by macros as an implementation detail
103pub mod __private {
104    pub use paste::paste;
105}