1pub mod aws;
15pub mod claude;
16pub mod gemini;
17pub mod openai;
18pub mod operation;
19mod path;
20pub mod spec;
21mod specs;
22
23pub use gproxy_protocol_macros::{WireBuilder, wire};
24
25#[cfg(test)]
26mod tests;
27
28pub use operation::{
29 ContentGenerationKind, Operation, OperationGroup, OperationKey, OperationKeyError,
30 OperationKind, WireFamily,
31};
32pub use path::{match_ingress, match_ingress_for, match_path, request_target};
33pub use spec::{
34 Affinity, Ingress, Matched, OperationSpec, PathPattern, Seg, SettleMode, StreamDetect,
35 StreamFraming, default_framing, streaming_sibling,
36};
37
38pub fn registered_operations() -> impl Iterator<Item = Operation> {
39 specs::REGISTRY.iter().map(|(operation, _)| *operation)
40}
41
42#[derive(Debug, Clone, PartialEq, Eq)]
44#[non_exhaustive]
45pub struct WireBuildError {
46 type_name: &'static str,
47 field: &'static str,
48}
49
50impl WireBuildError {
51 #[doc(hidden)]
52 pub const fn missing(type_name: &'static str, field: &'static str) -> Self {
53 Self { type_name, field }
54 }
55
56 pub const fn type_name(&self) -> &'static str {
57 self.type_name
58 }
59
60 pub const fn field(&self) -> &'static str {
61 self.field
62 }
63}
64
65impl std::fmt::Display for WireBuildError {
66 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
67 write!(
68 formatter,
69 "missing required field `{}.{}`",
70 self.type_name, self.field
71 )
72 }
73}
74
75impl std::error::Error for WireBuildError {}