1pub mod adapter_stats;
2pub mod checkpoint;
3pub mod circuit;
4pub mod completion_token;
5pub mod config;
6pub mod constants;
7pub mod coordination;
8pub mod deployment;
9pub mod duration;
10pub mod error;
11pub mod format;
12pub mod memory_pressure;
13pub mod pipeline_diff;
14pub mod postprocess;
15pub mod preprocess;
16pub mod program_schema;
17pub mod query;
18pub mod query_params;
19pub mod runtime_status;
20pub mod secret_ref;
21pub mod secret_resolver;
22pub mod serde_with_context;
23pub mod size;
24pub mod suspend;
25pub mod time_series;
26pub mod transaction;
27pub mod transport;
28pub mod variant;
29
30mod serde_via_value {
31 use serde::{
32 Deserialize, Deserializer, Serialize, Serializer,
33 de::{DeserializeOwned, Error},
34 ser::Error as _,
35 };
36
37 pub fn deserialize<'de, D, T>(deserializer: D) -> Result<T, D::Error>
50 where
51 D: Deserializer<'de>,
52 T: DeserializeOwned,
53 {
54 serde_json::from_value(serde_json::Value::deserialize(deserializer)?)
55 .map_err(D::Error::custom)
56 }
57
58 pub fn serialize<T, S>(value: &T, serializer: S) -> Result<S::Ok, S::Error>
59 where
60 T: Serialize,
61 S: Serializer,
62 {
63 serde_json::to_value(value)
64 .map_err(S::Error::custom)?
65 .serialize(serializer)
66 }
67}