cloudflare/framework/
mod.rs

1/*!
2This module controls how requests are sent to Cloudflare's API, and how responses are parsed from it.
3 */
4pub mod async_api;
5pub mod auth;
6#[cfg(not(target_arch = "wasm32"))] // There is no blocking implementation for wasm.
7pub mod endpoint;
8pub mod json_utils;
9#[cfg(not(target_arch = "wasm32"))] // The mock contains a blocking implementation.
10pub mod mock;
11
12mod environment;
13pub use environment::Environment;
14
15use serde::Serialize;
16
17pub trait ApiResultTraits: serde::de::DeserializeOwned + std::fmt::Debug {}
18
19/// Some endpoints return nothing. That's OK.
20impl ApiResultTraits for () {}
21
22#[derive(Serialize, Clone, Debug)]
23pub enum OrderDirection {
24    #[serde(rename = "asc")]
25    Ascending,
26    #[serde(rename = "desc")]
27    Descending,
28}
29
30/// Used as a parameter to API calls that search for a resource (e.g. DNS records).
31/// Tells the API whether to return results that match all search requirements or at least one (any).
32#[derive(Serialize, Clone, Debug)]
33#[serde(rename_all = "lowercase")]
34pub enum SearchMatch {
35    /// Match all search requirements
36    All,
37    /// Match at least one search requirement
38    Any,
39}