Skip to main content

http_grpc_rs/
status.rs

1use core::fmt;
2
3/// gRPC status codes as defined in the gRPC specification.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5#[repr(u8)]
6pub enum GrpcStatus {
7    Ok = 0,
8    Cancelled = 1,
9    Unknown = 2,
10    InvalidArgument = 3,
11    DeadlineExceeded = 4,
12    NotFound = 5,
13    AlreadyExists = 6,
14    PermissionDenied = 7,
15    ResourceExhausted = 8,
16    FailedPrecondition = 9,
17    Aborted = 10,
18    OutOfRange = 11,
19    Unimplemented = 12,
20    Internal = 13,
21    Unavailable = 14,
22    DataLoss = 15,
23    Unauthenticated = 16,
24}
25
26impl fmt::Display for GrpcStatus {
27    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
28        fmt::Debug::fmt(self, f)
29    }
30}