@@ -19,7 +19,7 @@ pub type NewStreamContext = fn(context_id: u32, root_context_id: u32) -> Box<dyn
19
19
pub type NewHttpContext = fn ( context_id : u32 , root_context_id : u32 ) -> Box < dyn HttpContext > ;
20
20
21
21
#[ repr( u32 ) ]
22
- #[ derive( Debug ) ]
22
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
23
23
pub enum LogLevel {
24
24
Trace = 0 ,
25
25
Debug = 1 ,
@@ -30,14 +30,14 @@ pub enum LogLevel {
30
30
}
31
31
32
32
#[ repr( u32 ) ]
33
- #[ derive( Debug ) ]
33
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
34
34
pub enum FilterStatus {
35
35
Continue = 0 ,
36
36
StopIteration = 1 ,
37
37
}
38
38
39
39
#[ repr( u32 ) ]
40
- #[ derive( Debug ) ]
40
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
41
41
pub enum FilterHeadersStatus {
42
42
Continue = 0 ,
43
43
StopIteration = 1 ,
@@ -47,20 +47,20 @@ pub enum FilterHeadersStatus {
47
47
}
48
48
49
49
#[ repr( u32 ) ]
50
- #[ derive( Debug ) ]
50
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
51
51
pub enum FilterMetadataStatus {
52
52
Continue = 0 ,
53
53
}
54
54
55
55
#[ repr( u32 ) ]
56
- #[ derive( Debug ) ]
56
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
57
57
pub enum FilterTrailersStatus {
58
58
Continue = 0 ,
59
59
StopIteration = 1 ,
60
60
}
61
61
62
62
#[ repr( u32 ) ]
63
- #[ derive( Debug ) ]
63
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
64
64
pub enum FilterDataStatus {
65
65
Continue = 0 ,
66
66
StopIterationAndBuffer = 1 ,
@@ -69,25 +69,7 @@ pub enum FilterDataStatus {
69
69
}
70
70
71
71
#[ repr( u32 ) ]
72
- #[ derive( Debug ) ]
73
- pub enum Status {
74
- Ok = 0 ,
75
- NotFound = 1 ,
76
- BadArgument = 2 ,
77
- SerializationFailure = 3 ,
78
- ParseFailure = 4 ,
79
- BadExpression = 5 ,
80
- InvalidMemoryAccess = 6 ,
81
- Empty = 7 ,
82
- CasMismatch = 8 ,
83
- ResultMismatch = 9 ,
84
- InternalFailure = 10 ,
85
- BrokenConnection = 11 ,
86
- Unimplemented = 12 ,
87
- }
88
-
89
- #[ repr( u32 ) ]
90
- #[ derive( Debug ) ]
72
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
91
73
pub enum BufferType {
92
74
HttpRequestBody = 0 ,
93
75
HttpResponseBody = 1 ,
@@ -101,7 +83,7 @@ pub enum BufferType {
101
83
}
102
84
103
85
#[ repr( u32 ) ]
104
- #[ derive( Debug ) ]
86
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
105
87
pub enum MapType {
106
88
HttpRequestHeaders = 0 ,
107
89
HttpRequestTrailers = 1 ,
@@ -114,15 +96,15 @@ pub enum MapType {
114
96
}
115
97
116
98
#[ repr( u32 ) ]
117
- #[ derive( Debug ) ]
99
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
118
100
pub enum PeerType {
119
101
Unknown = 0 ,
120
102
Local = 1 ,
121
103
Remote = 2 ,
122
104
}
123
105
124
106
#[ repr( u32 ) ]
125
- #[ derive( Debug ) ]
107
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
126
108
pub enum MetricType {
127
109
Counter = 0 ,
128
110
Gauge = 1 ,
@@ -132,8 +114,29 @@ pub enum MetricType {
132
114
pub type Bytes = Vec < u8 > ;
133
115
134
116
#[ repr( u32 ) ]
135
- #[ derive( Debug ) ]
117
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
136
118
pub enum StreamType {
137
119
Request = 0 ,
138
120
Response = 1 ,
139
121
}
122
+
123
+ // This is returned by the ABI and subject to additions, so make it
124
+ // non exhaustive.
125
+ #[ repr( u32 ) ]
126
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
127
+ #[ non_exhaustive]
128
+ pub enum Status {
129
+ Ok = 0 ,
130
+ NotFound = 1 ,
131
+ BadArgument = 2 ,
132
+ SerializationFailure = 3 ,
133
+ ParseFailure = 4 ,
134
+ BadExpression = 5 ,
135
+ InvalidMemoryAccess = 6 ,
136
+ Empty = 7 ,
137
+ CasMismatch = 8 ,
138
+ ResultMismatch = 9 ,
139
+ InternalFailure = 10 ,
140
+ BrokenConnection = 11 ,
141
+ Unimplemented = 12 ,
142
+ }
0 commit comments