@@ -168,18 +168,6 @@ macro_rules! c_enum {
168
168
$name: ident = $num: expr, ) * } ) => {
169
169
c_enum!( $c_name, $( #[ $enum_attr] ) * $enum_name { $( $( #[ $attr] ) * $name = $num) ,* } ) ;
170
170
} ;
171
- // Deprecated pattern.
172
- ( $doc: expr, $c_name: ident, $( #[ $enum_attr: meta] ) * $enum_name: ident { $( $( #[ $attr: meta] ) * value
173
- $name: ident = $num: expr) ,* } ) => {
174
- c_enum!( $c_name, #[ doc = $doc] $( #[ $enum_attr] ) *
175
- $enum_name { $( $( #[ $attr] ) * $name = $num) ,* } ) ;
176
- } ;
177
- // Deprecated pattern.
178
- ( $doc: expr, $c_name: ident, $( #[ $enum_attr: meta] ) * $enum_name: ident { $( $( #[ $attr: meta] ) * value
179
- $name: ident = $num: expr, ) * } ) => {
180
- c_enum!( $c_name, #[ doc = $doc] $( #[ $enum_attr] ) *
181
- $enum_name { $( $( #[ $attr] ) * $name = $num) ,* } ) ;
182
- }
183
171
}
184
172
185
173
////////////////////////
@@ -225,53 +213,55 @@ pub use tf::library;
225
213
226
214
////////////////////////
227
215
228
- c_enum ! ( "Error values that can be returned." , TF_Code , Code {
216
+ c_enum ! ( TF_Code ,
217
+ /// Error values that can be returned.
218
+ Code {
229
219
/// Not an error; returned on success.
230
- value Ok = 0 ,
220
+ Ok = 0 ,
231
221
232
222
/// The operation was cancelled (typically by the caller).
233
- value Cancelled = 1 ,
223
+ Cancelled = 1 ,
234
224
235
225
/// Unknown error. An example of where this error may be returned is
236
226
/// if a Status value received from another address space belongs to
237
227
/// an error-space that is not known in this address space. Also
238
228
/// errors raised by APIs that do not return enough error information
239
229
/// may be converted to this error.
240
- value Unknown = 2 ,
230
+ Unknown = 2 ,
241
231
242
232
/// Client specified an invalid argument. Note that this differs
243
233
/// from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments
244
234
/// that are problematic regardless of the state of the system
245
235
/// (e.g., a malformed file name).
246
- value InvalidArgument = 3 ,
236
+ InvalidArgument = 3 ,
247
237
248
238
/// Deadline expired before operation could complete. For operations
249
239
/// that change the state of the system, this error may be returned
250
240
/// even if the operation has completed successfully. For example, a
251
241
/// successful response from a server could have been delayed long
252
242
/// enough for the deadline to expire.
253
- value DeadlineExceeded = 4 ,
243
+ DeadlineExceeded = 4 ,
254
244
255
245
/// Some requested entity (e.g., file or directory) was not found.
256
246
/// For privacy reasons, this code *may* be returned when the client
257
247
/// does not have the access right to the entity.
258
- value NotFound = 5 ,
248
+ NotFound = 5 ,
259
249
260
250
/// Some entity that we attempted to create (e.g., file or directory)
261
251
/// already exists.
262
- value AlreadyExists = 6 ,
252
+ AlreadyExists = 6 ,
263
253
264
254
/// The caller does not have permission to execute the specified
265
255
/// operation. PERMISSION_DENIED must not be used for rejections
266
256
/// caused by exhausting some resource (use RESOURCE_EXHAUSTED
267
257
/// instead for those errors). PERMISSION_DENIED must not be
268
258
/// used if the caller can not be identified (use UNAUTHENTICATED
269
259
/// instead for those errors).
270
- value PermissionDenied = 7 ,
260
+ PermissionDenied = 7 ,
271
261
272
262
/// Some resource has been exhausted, perhaps a per-user quota, or
273
263
/// perhaps the entire file system is out of space.
274
- value ResourceExhausted = 8 ,
264
+ ResourceExhausted = 8 ,
275
265
276
266
/// Operation was rejected because the system is not in a state
277
267
/// required for the operation's execution. For example, directory
@@ -292,14 +282,14 @@ c_enum!("Error values that can be returned.", TF_Code, Code {
292
282
/// REST Get/Update/Delete on a resource and the resource on the
293
283
/// server does not match the condition. E.g., conflicting
294
284
/// read-modify-write on the same resource.
295
- value FailedPrecondition = 9 ,
285
+ FailedPrecondition = 9 ,
296
286
297
287
/// The operation was aborted, typically due to a concurrency issue
298
288
/// like sequencer check failures, transaction aborts, etc.
299
289
///
300
290
/// See litmus test above for deciding between FAILED_PRECONDITION,
301
291
/// ABORTED, and UNAVAILABLE.
302
- value Aborted = 10 ,
292
+ Aborted = 10 ,
303
293
304
294
/// Operation tried to iterate past the valid input range. E.g., seeking or
305
295
/// reading past end of file.
@@ -316,30 +306,30 @@ c_enum!("Error values that can be returned.", TF_Code, Code {
316
306
/// error) when it applies so that callers who are iterating through
317
307
/// a space can easily look for an OUT_OF_RANGE error to detect when
318
308
/// they are done.
319
- value OutOfRange = 11 ,
309
+ OutOfRange = 11 ,
320
310
321
311
/// Operation is not implemented or not supported/enabled in this service.
322
- value Unimplemented = 12 ,
312
+ Unimplemented = 12 ,
323
313
324
314
/// Internal errors. Means some invariants expected by underlying
325
315
/// system has been broken. If you see one of these errors,
326
316
/// something is very broken.
327
- value Internal = 13 ,
317
+ Internal = 13 ,
328
318
329
319
/// The service is currently unavailable. This is a most likely a
330
320
/// transient condition and may be corrected by retrying with
331
321
/// a backoff.
332
322
///
333
323
/// See litmus test above for deciding between FAILED_PRECONDITION,
334
324
/// ABORTED, and UNAVAILABLE.
335
- value Unavailable = 14 ,
325
+ Unavailable = 14 ,
336
326
337
327
/// Unrecoverable data loss or corruption.
338
- value DataLoss = 15 ,
328
+ DataLoss = 15 ,
339
329
340
330
/// The request does not have valid authentication credentials for the
341
331
/// operation.
342
- value Unauthenticated = 16 ,
332
+ Unauthenticated = 16 ,
343
333
} ) ;
344
334
345
335
////////////////////////
0 commit comments